/usr/share/doc/pgpool2/tutorial-watchdog-intro.html is in pgpool2 3.6.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Introduction</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="pgpool-II 3.6.1 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Watchdog"
HREF="tutorial-watchdog.html"><LINK
REL="PREVIOUS"
TITLE="Watchdog"
HREF="tutorial-watchdog.html"><LINK
REL="NEXT"
TITLE="Integrating external lifecheck with watchdog"
HREF="tutorial-watchdog-integrating-external-lifecheck.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2016-12-26T03:14:36"></HEAD
><BODY
CLASS="SECT1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="4"
ALIGN="center"
VALIGN="bottom"
><A
HREF="index.html"
>pgpool-II 3.6.1 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="Watchdog"
HREF="tutorial-watchdog.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="tutorial-watchdog.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Watchdog</TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="Integrating external lifecheck with watchdog"
HREF="tutorial-watchdog-integrating-external-lifecheck.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="TUTORIAL-WATCHDOG-INTRO"
>2.1. Introduction</A
></H1
><P
> Watchdog is a sub process of <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
to add high availability. Watchdog is used to resolve the single
point of failure by coordinating multiple <SPAN
CLASS="PRODUCTNAME"
>pgpool-II</SPAN
>
nodes. The watchdog was first introduced in <SPAN
CLASS="PRODUCTNAME"
>pgpool-II</SPAN
>
<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>V3.2</I
></SPAN
> and is significantly enhanced in
<SPAN
CLASS="PRODUCTNAME"
>pgpool-II</SPAN
> <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>V3.5</I
></SPAN
>, to ensure the presence of a
quorum at all time. This new addition to watchdog makes it more fault tolerant
and robust in handling and guarding against the split-brain syndrome
and network partitioning. However to ensure the quorum mechanism properly
works, the number of pgpool-II nodes must be odd in number and greater than or
equal to 3.
</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-COORDINATING-NODES"
>2.1.1. Coordinating multiple <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes</A
></H2
><P
> Watchdog coordinates multiple <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes
by exchanging information with each other.
</P
><P
> At the startup, if the watchdog is enabled, <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> node
sync the status of all configured backend nodes from the master watchdog node.
And if the node goes on to become a master node itself it initializes the backend
status locally. When a backend node status changes by failover etc..,
watchdog notifies the information to other <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
nodes and synchronizes them. When online recovery occurs, watchdog restricts
client connections to other <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
nodes for avoiding inconsistency between backends.
</P
><P
> Watchdog also coordinates with all connected <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes to ensure
that failback, failover and follow_master commands must be executed only on one <SPAN
CLASS="PRODUCTNAME"
>pgpool-II</SPAN
> node.
</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-LIFECHECKING"
>2.1.2. Life checking of other <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes</A
></H2
><P
> Watchdog lifecheck is the sub-component of watchdog to monitor
the health of <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes participating
in the watchdog cluster to provide the high availability.
Traditionally <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> watchdog provides
two methods of remote node health checking. <TT
CLASS="LITERAL"
>"heartbeat"</TT
>
and <TT
CLASS="LITERAL"
>"query"</TT
> mode.
The watchdog in <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>V3.5</I
></SPAN
>
adds a new <TT
CLASS="LITERAL"
>"external"</TT
> to <A
HREF="runtime-watchdog-config.html#GUC-WD-LIFECHECK-METHOD"
>wd_lifecheck_method</A
>,
which enables to hook an external third party health checking
system with <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> watchdog.
</P
><P
> Apart from remote node health checking watchdog lifecheck can also check
the health of node it is installed on by monitoring the connection to upstream servers.
If the monitoring fails, watchdog treats it as the local <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
node failure.
</P
><P
> In <TT
CLASS="LITERAL"
>heartbeat</TT
> mode, watchdog monitors other <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
processes by using <TT
CLASS="LITERAL"
>heartbeat</TT
> signal.
Watchdog receives heartbeat signals sent by other <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
periodically. If there is no signal for a certain period,
watchdog regards this as the failure of the <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>.
For redundancy you can use multiple network connections for heartbeat
exchange between <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes.
This is the default and recommended mode to be used for health checking.
</P
><P
> In <TT
CLASS="LITERAL"
>query</TT
> mode, watchdog monitors <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
service rather than process. In this mode watchdog sends queries to other
<SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> and checks the response.
</P><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
> Note that this method requires connections from other <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>,
so it would fail monitoring if the <A
HREF="runtime-config-connection.html#GUC-NUM-INIT-CHILDREN"
>num_init_children</A
> parameter isn't large enough.
This mode is deprecated and left for backward compatibility.
</P
></BLOCKQUOTE
></DIV
><P>
</P
><P
> <TT
CLASS="LITERAL"
>external</TT
> mode is introduced by <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>V3.5</I
></SPAN
>. This mode basically disables the built in lifecheck
of <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> watchdog and expects that the external system
will inform the watchdog about health of local and all remote nodes participating in the watchdog cluster.
</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-CONSISTENCY-OF-CONFIG"
>2.1.3. Consistency of configuration parameters on all <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes</A
></H2
><P
> At startup watchdog verifies the <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
configuration of the local node for the consistency with the configurations
on the master watchdog node and warns the user of any differences.
This eliminates the likelihood of undesired behavior that can happen
because of different configuration on different <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes.
</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-CHANGING-ACTIVE"
>2.1.4. Changing active/standby state when certain fault is detected</A
></H2
><P
> When a fault of <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> is detected,
watchdog notifies the other watchdogs of it.
If this is the active <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>,
watchdogs decide the new active <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
by voting and change active/standby state.
</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-AUTOMATIC-VIP"
>2.1.5. Automatic virtual IP switching</A
></H2
><P
> When a standby <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> server promotes to active,
the new active server brings up virtual IP interface. Meanwhile, the previous
active server brings down the virtual IP interface. This enables the active
<SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> to work using the same
IP address even when servers are switched.
</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-CHANGING-AUTOMATIC-REGISTER-IN-RECOVERY"
>2.1.6. Automatic registration of a server as a standby in recovery</A
></H2
><P
> When the broken server recovers or new server is attached, the watchdog process
notifies this to the other watchdogs in the cluster along with the information of the new server,
and the watchdog process receives information on the active server and
other servers. Then, the attached server is registered as a standby.
</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="TUTORIAL-WATCHDOG-START-STOP"
>2.1.7. Starting/stopping watchdog</A
></H2
><P
> The watchdog process starts and stops automatically as sub-processes
of the <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>, therefore there is no
dedicated command to start and stop watchdog.
</P
><P
> Watchdog controls the virtual IP interface, the commands executed by
the watchdog for bringing up and bringing down the VIP require the
root privileges. <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> requires the
user running <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> to have root
privileges when the watchdog is enabled along with delegate IP.
This is however not good security practice to run the
<SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> as root user, the alternative
and preferred way is to run the <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
>
as normal user and use either the custom commands for
<A
HREF="runtime-watchdog-config.html#GUC-IF-UP-CMD"
>if_up_cmd</A
>, <A
HREF="runtime-watchdog-config.html#GUC-IF-DOWN-CMD"
>if_down_cmd</A
>,
and <A
HREF="runtime-watchdog-config.html#GUC-ARPING-CMD"
>arping_cmd</A
> using <TT
CLASS="COMMAND"
>sudo</TT
>
or use <TT
CLASS="COMMAND"
>setuid</TT
> ("set user ID upon execution")
on <TT
CLASS="LITERAL"
>if_*</TT
> commands
</P
><P
> Lifecheck process is a sub-component of watchdog, its job is to monitor the
health of <SPAN
CLASS="PRODUCTNAME"
>Pgpool-II</SPAN
> nodes participating in
the watchdog cluster. The Lifecheck process is started automatically
when the watchdog is configured to use the built-in life-checking,
it starts after the watchdog main process initialization is complete.
However lifecheck process only kicks in when all configured watchdog
nodes join the cluster and becomes active. If some remote node fails
before the Lifecheck become active that failure will not get caught by the lifecheck.
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="tutorial-watchdog.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="tutorial-watchdog-integrating-external-lifecheck.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Watchdog</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="tutorial-watchdog.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Integrating external lifecheck with watchdog</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|