[pgpool-committers: 6913] pgpool: New feature: Simplify Watchdog related configuration parameters

Bo Peng pengbo at sraoss.co.jp
Tue Aug 11 01:02:30 JST 2020


New feature: Simplify Watchdog related configuration parameters.

This commit simplifies watchdog related configuration parameters
by using a common config file for each pgpool node and a pgpool_node_id file.

Previously we need to configure the following parameters on each pgpool node,
because of the difference between local and remote pgpool nodes settings.
- wd_hostname
- wd_port
- wd_heartbeat_port
- heartbeat_device
- heartbeat_destination0
- heartbeat_destination_port0
- heartbeat_destination1
- heartbeat_destination_port1
- other_pgpool_hostname0
- other_pgpool_port0
- other_wd_port0
- other_pgpool_hostname1
- other_pgpool_port1
- other_wd_port1

This commit simplifies watchdog related configuration by using a common config file
for each pgpool node and a pgpool_node_id file, and users just copy the configuration file
to each pgpool node without editing.

The parameters above are changed to (for 3 pgpool nodes):
(For example)
==============================
 hostname0 = 'server1'
 wd_port0 = 9000
 pgpool_port0 = 9999

 hostname1 = 'server2'
 wd_port1 = 9000
 pgpool_port1 = 9999

 hostname2 = 'server3'
 wd_port2 = 9000
 pgpool_port2 = 9999

 heartbeat_hostname0 = 'server1'
 heartbeat_port0 = 9694
 heartbeat_device0 = ''

 heartbeat_hostname1 = 'server2'
 heartbeat_port1 = 9694
 heartbeat_device1 = ''

 heartbeat_hostname2 = 'server3'
 heartbeat_port2 = 9694
 heartbeat_device2 = ''
==============================

You can specify multiple configurations in "heartbeat_hostname" and "heartbeat_device" by separating
them using semicolon (;).

And user needs to specify local pgpool node id in a pgpool_node_id file on each pgpool node.
pgpool_node_id file should be created in the direcroty of pgpool.conf.

In addition, this commit increases "WD_MESSAGE_DATA_VERSION_MINOR" to "2".

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a840ecb2c0aa15448f7fc63a7b0bb46949a9c24f

Modified Files
--------------
doc.ja/src/sgml/example-watchdog.sgml              |   7 +-
doc.ja/src/sgml/watchdog.sgml                      | 368 ++++++++++-----------
doc/src/sgml/example-watchdog.sgml                 |  10 +-
doc/src/sgml/watchdog.sgml                         | 245 +++++++-------
src/config/pool_config.c                           |  11 +-
src/config/pool_config_variables.c                 | 278 +++++++++++-----
src/include/pool.h                                 |   3 +
src/include/pool_config.h                          |  25 +-
src/include/watchdog/watchdog.h                    |   5 +-
src/sample/pgpool.conf.sample-logical              |  55 +--
src/sample/pgpool.conf.sample-raw                  |  56 ++--
src/sample/pgpool.conf.sample-replication          |  54 +--
src/sample/pgpool.conf.sample-slony                |  55 +--
src/sample/pgpool.conf.sample-snapshot             |  70 ++--
src/sample/pgpool.conf.sample-stream               |  71 ++--
src/test/regression/tests/004.watchdog/master.conf |  18 +-
.../regression/tests/004.watchdog/standby.conf     |  19 +-
src/test/regression/tests/004.watchdog/test.sh     |   2 +
.../tests/011.watchdog_quorum_failover/master.conf |  29 +-
.../011.watchdog_quorum_failover/standby.conf      |  29 +-
.../011.watchdog_quorum_failover/standby2.conf     |  29 +-
.../tests/011.watchdog_quorum_failover/test.sh     |   3 +
.../master.conf                                    |  29 +-
.../standby.conf                                   |  29 +-
.../standby2.conf                                  |  29 +-
.../test.sh                                        |   3 +
.../master.conf                                    |  29 +-
.../standby.conf                                   |  29 +-
.../standby2.conf                                  |  29 +-
.../test.sh                                        |   3 +
.../014.watchdog_test_quorum_bypass/master.conf    |  29 +-
.../tests/014.watchdog_test_quorum_bypass/test.sh  |   1 +
.../master.conf                                    |  29 +-
.../standby.conf                                   |  29 +-
.../standby2.conf                                  |  29 +-
.../015.watchdog_master_and_backend_fail/test.sh   |   3 +
src/test/watchdog_setup                            |  33 +-
src/tools/pgmd5/Makefile.am                        |   5 +-
src/tools/pgmd5/Makefile.in                        |   7 +-
src/tools/watchdog/Makefile.am                     |   3 +
src/tools/watchdog/Makefile.in                     |   9 +-
src/tools/watchdog/wd_cli.c                        |   5 +-
src/utils/pool_process_reporting.c                 |  72 ++--
src/watchdog/watchdog.c                            |  72 ++--
src/watchdog/wd_heartbeat.c                        |   2 +-
src/watchdog/wd_ipc_conn.c                         |   2 +-
src/watchdog/wd_json_data.c                        |  39 ++-
src/watchdog/wd_lifecheck.c                        |  22 +-
48 files changed, 1093 insertions(+), 920 deletions(-)



More information about the pgpool-committers mailing list