<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>I&#39;m new to pgpool and I&#39;m finding difficulties following the several guides I found on web.</div><div><br></div><div>I have 3 debian servers, 1 for pgpool (v 4.0.0) and 2 for the two postgresql servers (v 10.5, one primary and one hot standby, using streaming replication).</div><div><br></div><div>My pgpool can find the 2 nodes, but it mark both of them as standby. </div><div><div> node_id |  hostname   | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay | last_status_change  </div><div><font face="monospace, monospace" size="1">---------+-------------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------</font></div><div><font face="monospace, monospace" size="1"> 0       | 10.50.0.230 | 5432 | up     | 0.500000  | standby | 0          | false             | 0                 | 2018-10-24 15:58:13</font></div><div><font face="monospace, monospace" size="1"> 1       | 10.50.0.232 | 5432 | up     | 0.500000  | standby | 0          | true              | 0                 | 2018-10-24 15:58:13</font></div></div><div>Executing manually SELECT pg_is_in_recovery(); on the 2 postgresql server I correctly obtain false for the primary and true for the standby.</div><div><br></div><div>The connection to the 2 db works, I can send queries (with pgAdmin4) to pgpool and I can receive answer from both the DB (pgpool do balancing, so I can grow the 2 counter select_cnt).</div><div><br></div><div>(I also tried with the previous pgpool version, 3.7.5, but I have a different problem: node 0 is always detected as up, node 1 is always down, don&#39;t mind which server I put as node 0 and node 1)</div><div><br></div><div>I attach my pgpool config and the pgpool output.</div><div><br></div><div>Any help is welcome!</div><div>Thank you</div><div>Matteo M.</div><div><br></div><div><br></div><div>--------------------------------------------------------------------- pgpool.conf START -----------------------------------------------------</div><div><div>listen_addresses = &#39;*&#39;</div><div>port = 5432</div><div>socket_dir = &#39;/var/run/postgresql&#39;</div><div><br></div><div>pcp_listen_addresses = &#39;*&#39;</div><div>pcp_port = 9898</div><div>pcp_socket_dir = &#39;/var/run/postgresql&#39;</div><div>listen_backlog_multiplier = 2</div><div>serialize_accept = off</div><div><br></div><div><br></div><div>backend_hostname0 = &#39;10.50.0.230&#39;</div><div>backend_port0 = 5432</div><div>backend_weight0 = 1</div><div>backend_data_directory0 = &#39;/var/lib/postgresql/10/main&#39;</div><div>backend_flag0 = &#39;ALLOW_TO_FAILOVER&#39;</div><div><br></div><div>backend_hostname1 = &#39;10.50.0.232&#39;</div><div>backend_port1 = 5432</div><div>backend_weight1 = 1</div><div>backend_data_directory1 = &#39;/var/lib/postgresql/10/main&#39;</div><div>backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;</div><div><br></div><div>enable_pool_hba = on</div><div>pool_passwd = &#39;pool_passwd&#39;</div><div>authentication_timeout = 60</div><div>allow_clear_text_frontend_auth = off</div><div><br></div><div>ssl = off</div><div>#ssl_key = &#39;./server.key&#39;</div><div>#ssl_cert = &#39;./server.cert&#39;</div><div>#ssl_ca_cert = &#39;&#39;</div><div>#ssl_ca_cert_dir = &#39;&#39;</div><div><br></div><div>num_init_children = 32</div><div>max_pool = 4</div><div><br></div><div>child_life_time = 300</div><div>child_max_connections = 0</div><div>connection_life_time = 0</div><div>client_idle_limit = 0</div><div><br></div><div>log_destination = &#39;stderr&#39;</div><div>log_line_prefix = &#39;%t: pid %p: &#39;   # printf-style string to output at beginning of each log line.</div><div>log_connections = off</div><div>log_hostname = off</div><div>log_statement = off</div><div>log_per_node_statement = off</div><div>log_client_messages = off</div><div>log_standby_delay = &#39;if_over_threshold&#39;</div><div><br></div><div>syslog_facility = &#39;LOCAL0&#39;</div><div>syslog_ident = &#39;pgpool&#39;</div><div>log_error_verbosity = verbose</div><div>client_min_messages = debug5 </div><div>log_min_messages = debug5   </div><div><br></div><div>pid_file_name = &#39;/var/run/postgresql/pgpool.pid&#39;</div><div>logdir = &#39;/tmp&#39;</div><div><br></div><div>connection_cache = on</div><div>reset_query_list = &#39;ABORT; DISCARD ALL&#39;</div><div>#reset_query_list = &#39;ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT&#39;</div><div><br></div><div>replication_mode = off</div><div>replicate_select = off</div><div>insert_lock = off</div><div>lobj_lock_table = &#39;&#39;</div><div><br></div><div>replication_stop_on_mismatch = off</div><div>failover_if_affected_tuples_mismatch = off</div><div><br></div><div>load_balance_mode = on</div><div>ignore_leading_white_space = on</div><div>white_function_list = &#39;&#39;</div><div>black_function_list = &#39;currval,lastval,nextval,setval&#39;</div><div>black_query_pattern_list = &#39;&#39;</div><div>database_redirect_preference_list = &#39;&#39;</div><div>app_name_redirect_preference_list = &#39;&#39;</div><div>allow_sql_comments = off</div><div>disable_load_balance_on_write = &#39;transaction&#39;<span style="white-space:pre">        </span></div><div><br></div><div>master_slave_mode = on</div><div>master_slave_sub_mode = &#39;stream&#39;</div><div><br></div><div>sr_check_period = 10</div><div>sr_check_user = &#39;postgres&#39;</div><div>sr_check_password = &#39;postgres&#39;</div><div>sr_check_database = &#39;postgres&#39;</div><div>delay_threshold = 10000000</div><div><br></div><div>follow_master_command = &#39;&#39;</div><div><br></div><div>health_check_period = 5</div><div>health_check_timeout = 20</div><div>health_check_user = &#39;postgres&#39;</div><div>health_check_password = &#39;postgres&#39;</div><div>health_check_database = &#39;postgres&#39;</div><div>health_check_max_retries = 0</div><div>health_check_retry_delay = 1</div><div>connect_timeout = 10000</div><div><br></div><div>failover_command = &#39;/etc/pgpool2/4.0.0/failover.sh %d %P %H replication /etc/postgresql/10/main/start_as_master&#39;</div><div>failback_command = &#39;&#39;</div><div>failover_on_backend_error = on</div><div>detach_false_primary = off</div><div>search_primary_node_timeout = 300</div><div><br></div><div>recovery_user = &#39;postgres&#39;</div><div>recovery_password = &#39;postgres&#39;</div><div>recovery_1st_stage_command = &#39;recovery_1st_stage.sh&#39;</div><div>recovery_2nd_stage_command = &#39;&#39;</div><div>recovery_timeout = 90</div><div>client_idle_limit_in_recovery = 0</div><div><br></div><div>use_watchdog = off</div><div>trusted_servers = &#39;&#39;</div><div>ping_path = &#39;/bin&#39;</div><div>wd_hostname = &#39;&#39;</div><div>wd_port = 9000</div><div>wd_priority = 1</div><div>wd_authkey = &#39;&#39;</div><div>wd_ipc_socket_dir = &#39;/tmp&#39;</div><div><br></div><div>delegate_IP = &#39;&#39;</div><div>if_cmd_path = &#39;/sbin&#39;</div><div>if_up_cmd = &#39;ip addr add $_IP_$/24 dev eth0 label eth0:0&#39;</div><div>if_down_cmd = &#39;ip addr del $_IP_$/24 dev eth0&#39;</div><div>arping_path = &#39;/usr/sbin&#39;</div><div>arping_cmd = &#39;arping -U $_IP_$ -w 1&#39;</div><div><br></div><div>clear_memqcache_on_escalation = on</div><div>wd_escalation_command = &#39;&#39;</div><div>wd_de_escalation_command = &#39;&#39;</div><div>failover_when_quorum_exists = on</div><div>failover_require_consensus = on</div><div>allow_multiple_failover_requests_from_node = off</div><div><br></div><div>wd_monitoring_interfaces_list = &#39;&#39;  # Comma separated list of interfaces names to monitor.</div><div>wd_lifecheck_method = &#39;heartbeat&#39;</div><div>wd_interval = 10</div><div>wd_heartbeat_port = 9694</div><div>wd_heartbeat_keepalive = 2</div><div>wd_heartbeat_deadtime = 30</div><div><br></div><div>#heartbeat_destination0 = &#39;host0_ip1&#39;</div><div>#heartbeat_destination_port0 = 9694 </div><div>#heartbeat_device0 = &#39;&#39;</div><div><br></div><div>#heartbeat_destination1 = &#39;host0_ip2&#39;</div><div>#heartbeat_destination_port1 = 9694</div><div>#heartbeat_device1 = &#39;&#39;</div><div><br></div><div>wd_life_point = 3</div><div>wd_lifecheck_query = &#39;SELECT 1&#39;</div><div>wd_lifecheck_dbname = &#39;template1&#39;</div><div>wd_lifecheck_user = &#39;nobody&#39;</div><div>wd_lifecheck_password = &#39;&#39;</div><div><br></div><div>#other_pgpool_hostname0 = &#39;host0&#39;</div><div>#other_pgpool_port0 = 5432</div><div>#other_wd_port0 = 9000</div><div>#other_pgpool_hostname1 = &#39;host1&#39;</div><div>#other_pgpool_port1 = 5432</div><div>#other_wd_port1 = 9000</div><div><br></div><div>relcache_expire = 0</div><div>relcache_size = 256</div><div>check_temp_table = on</div><div>check_unlogged_table = on</div><div><br></div><div>memory_cache_enabled = off</div><div>memqcache_method = &#39;shmem&#39;</div><div>memqcache_memcached_host = &#39;localhost&#39;</div><div>memqcache_memcached_port = 11211</div><div>memqcache_total_size = 67108864</div><div>memqcache_max_num_cache = 1000000</div><div>memqcache_expire = 0</div><div>memqcache_auto_cache_invalidation = on</div><div>memqcache_maxcache = 409600</div><div>memqcache_cache_block_size = 1048576</div><div>memqcache_oiddir = &#39;/var/log/pgpool/oiddir&#39;</div><div>white_memqcache_table_list = &#39;&#39;</div><div>black_memqcache_table_list = &#39;&#39;</div></div><div><br></div><div><div>--------------------------------------------------------------------- pgpool.conf END -----------------------------------------------------</div><br class="gmail-Apple-interchange-newline"></div><div><div>--------------------------------------------------------------------- pgpool.log -----------------------------------------------------</div><div>The output is too long for an email (10k rows for 1 minute and half).</div><div>It is available here: <a href="https://drive.google.com/file/d/1fho2gh4JTBgjiY6bHlpUQAkB8tjS2ute/view?usp=sharing">https://drive.google.com/file/d/1fho2gh4JTBgjiY6bHlpUQAkB8tjS2ute/view?usp=sharing</a></div><div><br></div><div><br></div><br class="gmail-Apple-interchange-newline"></div></div></div></div></div></div>