<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>3-node pg 9.5 streaming replica cluster with repmgr is up and working...</div><div><br></div><div>1-node pgpool 4.0.4 is up and running, can&#39;t say totally working yet because some access attempts fail.  but it sees the cluster and some connection attempts succeed. (only as pgpool user on the localhost of pgpool, (of course all connections local on the primary postgres server works as they always have, and all remote client connections as postgres to any of the cluster servers still work--but not to the pgpool server)</div><div><br></div><div><div>-bash-4.2$ psql -U pgpool --dbname=pgpool --host localhost -c &quot;show pool_nodes&quot;</div><div> node_id |   hostname    | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay | last_status_change  </div><div>---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------</div><div> 0       | 192.168.95.15 | 5432 | up     | 0.333333  | primary | 2          | false             | 0                 | 2019-05-03 15:00:34</div><div> 1       | 192.168.95.14 | 5432 | up     | 0.333333  | standby | 0          | true              | 0                 | 2019-05-03 15:00:34</div><div> 2       | 192.168.95.13 | 5432 | up     | 0.333333  | standby | 0          | false             | 0                 | 2019-05-03 15:00:34</div><div>(3 rows)</div></div><div><br></div><div>and, this works:</div><div>  psql -h localhost -p 5432 -U pgpool</div><div>It drops me right into the database, from which I can \l or whatever and see all my prod db&#39;s on the cluster, from there I can \c and attach to a live prod db and list tables, whatever, so with this I&#39;m in.</div><div><br></div><div>1) but connecting as postgres fails, changing this to use the real hostname instead of localhost it fails for -both- pgpool and postgres:</div><div><div>  -bash-4.2$ psql -h localhost -p 5432 -U postgres</div><div>  psql: ERROR:  authentication failed</div><div>  DETAIL:  password authentication failed for user &quot;postgres&quot;</div></div><div><br></div><div>2) and if I try connection from a remote (client) host it fails at the hba:</div><div>  psql -h r01sv02 -p 5432 -U postgres<br></div><div><div>  psql: FATAL:  client authentication failed</div><div>  DETAIL:  no pool_hba.conf entry for host &quot;192.168.95.10&quot;, user &quot;postgres&quot;, database &quot;postgres&quot;, SSL off</div><div>  HINT:  see pgpool log for details</div></div><div><br></div><div>3) And running any of the pcp_* utilities from the command line fails:</div><div><br></div><div><div>  -bash-4.2$ pcp_pool_status -v -p 9898 -h /var/run/pgpool -U pgpool</div><div>  Password: </div><div>  FATAL:  authentication failed for user &quot;pgpool&quot;</div><div>  DETAIL:  username and/or password does not match</div></div><div><br></div><div>first, it prompts me for password which I thought it would not since the .pcppass file exists, but in any case when I provide it I&#39;m told it failed.</div><div><br></div><div><div>-bash-4.2$ ls -lah /var/run/pgpool/.s.*</div><div>srwxrwxrwx. 1 postgres postgres 0 May  3 15:00 /var/run/pgpool/.s.PGSQL.5432</div><div>srwxrwxrwx. 1 postgres postgres 0 May  3 15:00 /var/run/pgpool/.s.PGSQL.9898</div></div><div><br></div><div>If you can, I need help figuring out why the pool_hba.conf seems to be claiming a host is not listed which Is in fact listed as part of a subnet md5 entry.  -as well- get complaints about passwords failing when the password is the same everywhere in this build right now, postgres, repmgr, pgpool all using the same postgres password set in the original production standalone postgres build.<br></div><div dir="ltr"><br></div><div>Here are relevant config files:</div><div>---------------------------------------</div><div dir="ltr"><div>All three cluster members plus the one pgpool server have this same file in the postgres user home_dir</div><div><br></div><div>-rw-------. 1 postgres postgres 328 May  3 14:27 .pgpass<br></div><div><div>localhost:5432:*:postgres:secret</div><div>r01sv04:5432:replication:repmgr:secret</div><div>r01sv03:5432:*:postgres:secret</div><div>r01sv05:5432:replication:repmgr:secret</div><div>r01sv05:5432:*:postgres:secret</div><div>r01sv04:5432:*:postgres:secret</div><div>r01sv03:5432:replication:repmgr:secret</div><div>r01sv02:5432:*:pgpool:secret</div></div><div><br></div><div>additionally, the pgpool server has the required .pcppass and pool_passwd files which look like this:</div><div><br></div><div>in postgres $homedir:</div><div>-rw-------.  1 postgres postgres   52 May  3 18:10 .pcppass<br></div><div><div>*:*:postgres:secret</div><div>*:*:pgpool:secret</div></div><div><br></div><div>in postgres $homedir/pgpool:</div><div>-rw-------. 1 postgres postgres    82 Apr 25 19:19 pcp.conf<br></div><div><div>postgres:pg_md5-hash-of-secret-same-in all-entries</div><div>pgpool:pg_md5-hash-of-secret-same-in all-entries</div></div><div><br></div><div>rw-------. 1 postgres postgres    82 Apr 25 19:19 pool_passwd<br></div><div><div>postgres:pg_md5-hash-of-secret-same-in all-entries</div><div>pgpool:pg_md5-hash-of-secret-same-in all-entries</div></div><div><br></div><div>postgres $homedir/pgpool/pool_hba.conf</div><div>-----------------------</div><div><div># TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD</div><div># &quot;local&quot; is for Unix domain socket connections only<br></div><div>local   all         all                               trust</div><div># IPv4 local connections:</div><div>host    all         all         <a href="http://127.0.0.1/32" target="_blank">127.0.0.1/32</a>          trust</div><div>host    all         all         ::1/128               trust</div><div>host    all         all         <a href="http://192.168.95.0/24" target="_blank">192.168.95.0/24</a>              md5     <i>&lt;---this is my whole subnet</i></div></div><div><br></div><div><br></div><div>my pg_hba.conf</div><div>----------------------</div><div><div># TYPE  DATABASE        USER            ADDRESS                 METHOD</div><div># the cluster trusts need to be at the top of the file</div><div>host    all             pgpool          <a href="http://192.168.95.12/32" target="_blank">192.168.95.12/32</a>      trust</div><div>host    repmgr          repmgr          <a href="http://192.168.95.15/32" target="_blank">192.168.95.15/32</a>      trust</div><div>host    replication     repmgr          <a href="http://192.168.95.15/32" target="_blank">192.168.95.15/32</a>      trust</div><div>host    repmgr          repmgr          <a href="http://192.168.95.14/32" target="_blank">192.168.95.14/32</a>      trust</div><div>host    replication     repmgr          <a href="http://192.168.95.14/32" target="_blank">192.168.95.14/32</a>      trust</div><div>host    repmgr          repmgr          <a href="http://192.168.95.13/32" target="_blank">192.168.95.13/32</a>      trust</div><div>host    replication     repmgr          <a href="http://192.168.95.13/32" target="_blank">192.168.95.13/32</a>      trust</div><div># &quot;local&quot; is for Unix domain socket connections only</div><div>local   all             all                                     md5</div><div># IPv4 local connections:</div><div>host    all             all             <a href="http://127.0.0.1/32" target="_blank">127.0.0.1/32</a>            md5</div><div># IPv6 local connections:</div><div>host    all             all             ::1/128                 md5</div><div>#Application Connections</div><div>host    all             all                     <a href="http://192.168.95.0/24" target="_blank">192.168.95.0/24</a>               md5   <i>&lt;---this is my whole subnet (and this works for postgres, just the other one doesn&#39;t seem to work for pgpool)</i></div></div><div><br></div><div>pgpool.conf entries:  (you can ignored the watchdog and related stuff because we&#39;re not using it)<br></div><div>----------------------------------------</div><div><div>listen_addresses = &#39;0.0.0.0&#39;</div><div>port = &#39;5432&#39;</div><div>socket_dir = &#39;/var/run/pgpool&#39;</div><div>pcp_listen_addresses = &#39;0.0.0.0&#39;</div><div>pcp_port = &#39;9898&#39;</div><div>pcp_socket_dir = &#39;/var/run/pgpool&#39;</div><div>listen_backlog_multiplier = &#39;2&#39;</div><div>serialize_accept = &#39;off&#39;</div><div>backend_hostname0 = &#39;192.168.95.15&#39;</div><div>backend_port0 = &#39;5432&#39;</div><div>backend_weight0 = 1</div><div>backend_data_directory0 = &#39;/var/lib/pgsql/9.5/data&#39;</div><div>backend_flag0 = &#39;ALLOW_TO_FAILOVER&#39;</div><div>backend_hostname1 = &#39;192.168.95.14&#39;</div><div>backend_port1 = &#39;5432&#39;</div><div>backend_weight1 = 1</div><div>backend_data_directory1 = &#39;/var/lib/pgsql/9.5/data&#39;</div><div>backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;</div><div>backend_hostname2 = &#39;192.168.95.13&#39;</div><div>backend_port2 = &#39;5432&#39;</div><div>backend_weight2 = 1</div><div>backend_data_directory2 = &#39;/var/lib/pgsql/9.5/data&#39;</div><div>backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;</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_ciphers = &#39;HIGH:MEDIUM:+3DES:!aNULL&#39;</div><div>ssl_prefer_server_ciphers = off</div><div>num_init_children = 32</div><div>max_pool = 4</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>log_destination = &#39;stderr,syslog&#39;</div><div>log_line_prefix = &#39;%t: pid %p: &#39;</div><div>log_connections = &#39;off&#39;</div><div>log_hostname = &#39;on&#39;</div><div>log_statement = &#39;off&#39;</div><div>log_per_node_statement = &#39;off&#39;</div><div>log_client_messages = &#39;off&#39;</div><div>log_standby_delay = &#39;if_over_threshold&#39;</div><div>syslog_facility = &#39;LOCAL0&#39;</div><div>syslog_ident = &#39;pgpool&#39;</div><div>log_error_verbosity = &#39;default&#39;</div><div>client_min_messages = &#39;notice&#39;</div><div>log_min_messages = &#39;warning&#39;</div><div>pid_file_name = &#39;/var/run/pgpool/pgpool.pid&#39;</div><div>logdir = &#39;/var/log/postgres&#39;</div><div>connection_cache = &#39;on&#39;</div><div><br></div><div>reset_query_list = &#39;ABORT; DISCARD ALL&#39;</div><div>replication_mode = off</div><div>replicate_select = off</div><div>insert_lock = off</div><div>lobj_lock_table = &#39;&#39;</div><div>replication_stop_on_mismatch = off</div><div>failover_if_affected_tuples_mismatch = off</div><div>load_balance_mode = &#39;on&#39;</div><div>ignore_leading_white_space = &#39;on&#39;</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 = &#39;off&#39;</div><div>disable_load_balance_on_write = &#39;transaction&#39;</div><div>master_slave_mode = &#39;on&#39;</div><div>master_slave_sub_mode = &#39;stream&#39;</div><div><br></div><div>sr_check_period = &#39;10&#39;</div><div>sr_check_user = &#39;pgpool&#39;</div><div>sr_check_password = &#39;secret&#39;</div><div>sr_check_database = &#39;pgpool&#39;</div><div>delay_threshold = &#39;10000000&#39;</div><div>follow_master_command = &#39;&#39;</div><div>health_check_period = &#39;10&#39;</div><div>health_check_timeout = &#39;20&#39;</div><div>health_check_user = &#39;pgpool&#39;</div><div>health_check_password = &#39;secret&#39;</div><div>health_check_database = &#39;pgpool&#39;</div><div>health_check_max_retries = &#39;0&#39;</div><div>health_check_retry_delay = &#39;1&#39;</div><div>connect_timeout = &#39;10000&#39;</div><div>failover_command = &#39;/var/lib/pgsql/pgpool/bin/failover.sh %d %h %p %D %m %H %M %P %r %R %%&#39;</div><div>failover_on_backend_error = &#39;on&#39;</div><div>detach_false_primary = &#39;off&#39;</div><div>search_primary_node_timeout = &#39;300&#39;</div><div>recovery_user = &#39;&#39;</div><div>recovery_password = &#39;&#39;</div><div>recovery_1st_stage_command = &#39;&#39;</div><div>recovery_2nd_stage_command = &#39;&#39;</div><div>recovery_timeout = 90</div><div>client_idle_limit_in_recovery = 0</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;/var/run/pgpool&#39;</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>clear_memqcache_on_escalation = &#39;off&#39;</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>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>heartbeat_destination0 = &#39;host0_ip1&#39;</div><div>heartbeat_destination_port0 = 9694 </div><div>heartbeat_device0 = &#39;&#39;</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;pgpool&#39;</div><div>wd_lifecheck_password = &#39;secret&#39;</div><div>relcache_expire = &#39;0&#39;</div><div>relcache_size = &#39;256&#39;</div><div>check_temp_table = &#39;on&#39;</div><div>check_unlogged_table = &#39;on&#39;</div><div>memory_cache_enabled = &#39;on&#39;</div><div>memqcache_method = &#39;shmem&#39;</div><div>memqcache_memcached_host = &#39;localhost&#39;</div><div>memqcache_memcached_port = &#39;11211&#39;</div><div>memqcache_total_size = &#39;67108864&#39;</div><div>memqcache_max_num_cache = &#39;1000000&#39;</div><div>memqcache_expire = &#39;0&#39;</div><div>memqcache_auto_cache_invalidation = &#39;on&#39;</div><div>memqcache_maxcache = &#39;409600&#39;</div><div>memqcache_cache_block_size = &#39;1048576&#39;</div><div>memqcache_oiddir = &#39;/var/log/postgres/oiddir&#39;</div><div>white_memqcache_table_list = &#39;&#39;</div><div>black_memqcache_table_list = &#39;&#39;</div></div><div><br></div><div>Thanks,</div><div>Rob</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>