<div dir="ltr"><div>Hi</div><div><br></div>You have not shared the pgpool.conf of second server, but as you mentioned that its same except (how I understand it) other_pgpool_hostname0 on that would be "<a href="http://pgsql01.example.com">pgsql01.example.com</a>"<div>if thats the case then I guess the problem is in the other_wd_port0  setting.</div><div>other_wd_port0 corresponds to the wd_port of the other node, are you using  is 9694 for wd_port on the second node? which is unlikely because you are using 9694 port for the heartbeat</div><div>most probably you need to change the other_wd_port0 to 9000 if wd_port on that node is same as on the one you shared pgpool.conf for.</div><div><br></div><div>Kind regards</div><div>Muhammad Usama</div><div><br></div><div><br></div><div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 17, 2018 at 6:15 PM mjb2kmn <<a href="mailto:mjb2kmn@gmail.com">mjb2kmn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to deploy pgpool in native replication mode with watchdog<br>
to manage 2 nodes for Active-Standby.<br>
When I start pgpool2 on both servers, they each claim to be the only<br>
node alive and become master.<br>
<br>
I have lifecheck method of heartbeat and set the heartbeat<br>
destinations to the other host for each host. I confirmed that I can<br>
send UDP messages between hosts with nc. Am I missing or<br>
misunderstanding something?<br>
<br>
Also I don't understand what the watchdog port actually does, if the<br>
heartbeat port send and receive the health check and pcp has it's own<br>
port for management, what does the watchdog TCP socket do?<br>
<br>
Below is pgpool.conf from 1st server, second server's config is the<br>
same except for the 01/02 in the hostnames. Config has been trimmed<br>
down a little, mostly just comments and unrelated stuff removed for<br>
brevity (logging, cache)<br>
<br>
<br>
#------------------------------------------------------------------------------<br>
# CONNECTIONS<br>
#------------------------------------------------------------------------------<br>
<br>
# - pgpool Connection Settings -<br>
listen_addresses = '*'<br>
port = 6432<br>
socket_dir = '/var/run/postgresql'<br>
listen_backlog_multiplier = 2<br>
serialize_accept = off<br>
pcp_listen_addresses = '*'<br>
pcp_port = 9898<br>
pcp_socket_dir = '/var/run/postgresql'<br>
<br>
# - Backend Connection Settings -<br>
backend_hostname0 = '<a href="http://pgsql01.example.com" rel="noreferrer" target="_blank">pgsql01.example.com</a>'<br>
backend_port0 = 5432<br>
backend_weight0 = 1<br>
backend_data_directory0 = '/var/lib/pgsql/data'<br>
backend_flag0 = 'ALLOW_TO_FAILOVER'<br>
backend_hostname1 = '<a href="http://pgsql02.example.com" rel="noreferrer" target="_blank">pgsql02.example.com</a>'<br>
backend_port1 = 5432<br>
backend_weight1 = 1<br>
backend_data_directory1 = '/var/lib/pgsql/data'<br>
backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
<br>
# - Authentication -<br>
enable_pool_hba = on<br>
pool_passwd = 'pool_passwd'<br>
authentication_timeout = 60<br>
<br>
# - SSL Connections -<br>
ssl = off<br>
<br>
#------------------------------------------------------------------------------<br>
# POOLS<br>
#------------------------------------------------------------------------------<br>
<br>
# - Concurrent session and pool size -<br>
num_init_children = 32<br>
max_pool = 4<br>
# - Life time -<br>
child_life_time = 300<br>
child_max_connections = 0<br>
connection_life_time = 0<br>
client_idle_limit = 0<br>
<br>
#------------------------------------------------------------------------------<br>
# CONNECTION POOLING<br>
#------------------------------------------------------------------------------<br>
<br>
connection_cache = on<br>
reset_query_list = 'ABORT; DISCARD ALL'<br>
<br>
<br>
#------------------------------------------------------------------------------<br>
# REPLICATION MODE<br>
#------------------------------------------------------------------------------<br>
<br>
replication_mode = on<br>
replicate_select = off<br>
insert_lock = on<br>
lobj_lock_table = ''<br>
# - Degenerate handling -<br>
replication_stop_on_mismatch = off<br>
failover_if_affected_tuples_mismatch = off<br>
<br>
<br>
#------------------------------------------------------------------------------<br>
# LOAD BALANCING MODE<br>
#------------------------------------------------------------------------------<br>
<br>
load_balance_mode = on<br>
ignore_leading_white_space = on<br>
white_function_list = ''<br>
black_function_list = 'nextval,setval,nextval,setval'<br>
database_redirect_preference_list = ''<br>
app_name_redirect_preference_list = ''<br>
allow_sql_comments = on<br>
<br>
#------------------------------------------------------------------------------<br>
# MASTER/SLAVE MODE<br>
#------------------------------------------------------------------------------<br>
<br>
master_slave_mode = off<br>
master_slave_sub_mode = 'stream'<br>
# - Streaming -<br>
sr_check_period = 0<br>
sr_check_user = 'nobody'<br>
sr_check_password = ''<br>
sr_check_database = 'postgres'<br>
delay_threshold = 0<br>
# - Special commands -<br>
follow_master_command = ''<br>
<br>
#------------------------------------------------------------------------------<br>
# HEALTH CHECK GLOBAL PARAMETERS<br>
#------------------------------------------------------------------------------<br>
<br>
health_check_period = 0<br>
health_check_timeout = 20<br>
health_check_user = 'nobody'<br>
health_check_password = ''<br>
health_check_database = ''<br>
health_check_max_retries = 0<br>
health_check_retry_delay = 1<br>
connect_timeout = 10000<br>
<br>
#------------------------------------------------------------------------------<br>
# FAILOVER AND FAILBACK<br>
#------------------------------------------------------------------------------<br>
<br>
failover_command = ''<br>
failback_command = ''<br>
fail_over_on_backend_error = on<br>
search_primary_node_timeout = 300<br>
<br>
#------------------------------------------------------------------------------<br>
# ONLINE RECOVERY<br>
#------------------------------------------------------------------------------<br>
<br>
recovery_user = 'nobody'<br>
recovery_password = ''<br>
recovery_1st_stage_command = ''<br>
recovery_2nd_stage_command = ''<br>
recovery_timeout = 90<br>
client_idle_limit_in_recovery = 0<br>
<br>
#------------------------------------------------------------------------------<br>
# WATCHDOG<br>
#------------------------------------------------------------------------------<br>
<br>
# - Enabling -<br>
use_watchdog = on<br>
trusted_servers =<br>
'<a href="http://pgsql-test.example.com" rel="noreferrer" target="_blank">pgsql-test.example.com</a>,<a href="http://proxy.example.com" rel="noreferrer" target="_blank">proxy.example.com</a>,<a href="http://proxy01.example.com" rel="noreferrer" target="_blank">proxy01.example.com</a>,<a href="http://proxy02.example.com" rel="noreferrer" target="_blank">proxy02.example.com</a>'<br>
ping_path = '/bin'<br>
# - Watchdog communication Settings -<br>
wd_hostname = '<a href="http://pgsql01.example.com" rel="noreferrer" target="_blank">pgsql01.example.com</a>'<br>
wd_port = 9000<br>
wd_priority = 2<br>
wd_authkey = 'Hunter1'<br>
wd_ipc_socket_dir = '/tmp'<br>
<br>
# - Virtual IP control Setting -<br>
delegate_IP = '10.10.10.92'<br>
if_cmd_path = '/sbin'<br>
if_up_cmd = 'ip addr add $_IP_$/23 dev ens192 label ens192:0'<br>
if_down_cmd = 'ip addr del $_IP_$/23 dev ens192'<br>
arping_path = '/usr/bin'<br>
arping_cmd = 'arping -U $_IP_$ -w 1'<br>
<br>
# - Behaivor on escalation Setting -<br>
clear_memqcache_on_escalation = on<br>
wd_escalation_command = ''<br>
wd_de_escalation_command = ''<br>
<br>
# - Watchdog consensus settings for failover -<br>
failover_when_quorum_exists = on<br>
failover_require_consensus = on<br>
allow_multiple_failover_requests_from_node = off<br>
<br>
# -- common --<br>
wd_monitoring_interfaces_list = ''  # Comma separated list of<br>
interfaces names to monitor.<br>
wd_lifecheck_method = 'heartbeat'<br>
wd_interval = 5<br>
<br>
# -- heartbeat mode --<br>
wd_heartbeat_port = 9694<br>
wd_heartbeat_keepalive = 2<br>
wd_heartbeat_deadtime = 30<br>
heartbeat_destination0 = '<a href="http://pgsql02.example.com" rel="noreferrer" target="_blank">pgsql02.example.com</a>'<br>
heartbeat_destination_port0 = 9694<br>
heartbeat_device0 = ''<br>
<br>
# -- query mode --<br>
wd_life_point = 3<br>
wd_lifecheck_query = 'SELECT 1'<br>
wd_lifecheck_dbname = 'template1'<br>
wd_lifecheck_user = 'nobody'<br>
wd_lifecheck_password = ''<br>
<br>
# - Other pgpool Connection Settings -<br>
other_pgpool_hostname0 = 'pgsql02'<br>
other_pgpool_port0 = 6432<br>
other_wd_port0 = 9694<br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</blockquote></div></div></div></div>