<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    I'm trying to install a simple 2 node pgpool2 cluster with hot
    standby streaming replication and automatic failover.<br>
    <br>
    So far the streaming replication between 2 postresql servers is
    working perfectly. For the failover part I'm using repmgr which also
    works great.<br>
    <br>
    I can connect to both postgresql backends and also I can connect to
    both postgresql backends through pgpool2. <br>
    <br>
    The automatic failover works. When I stop the master node, I can see
    that the standby becomes new master. I'm able to directly connect to
    new master postgresql node and it is no longer in read only mode.
    However when I want to connect to the cluster (after the failover)
    through pgpool2 (using psql client) the connection waits forever and
    I'm no longer to connect. I've turned on connection logging for
    postgresql and there is no record of an attempted connection.
    Pgpool2 log also doesn't show incomming connection attempt. To be
    able to connect through pgpool2 again, I must restart it.<br>
    <br>
    I'm unable to connect only after the master failover. If I stop the
    standby node, the backend is correctly detected as down, but I'm
    still able to connect to pgpool2.<br>
    <br>
    Please help. Thank you.<br>
    <br>
    My setup is:<br>
    <br>
    2x PostgreSQL 9.3.2 on x86_64-unknown-linux-gnu, compiled by gcc
    (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit<br>
    pgpool-II version 3.3.2 (tokakiboshi) (I've also tried the latest
    master at 46c9a71813768fa799580f3ae07599b9eaa14fef)<br>
    Linux 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013
    x86_64 x86_64 x86_64 GNU/Linux<br>
    <br>
    My pgpool.conf is:<br>
    <br>
    listen_addresses = '*'<br>
    port = 9999<br>
    socket_dir = '/tmp'<br>
    pcp_port = 9898<br>
    pcp_socket_dir = '/tmp'<br>
    backend_hostname0 = 'dbnode1'<br>
    backend_port0 = 5432<br>
    backend_weight0 = 1<br>
    backend_data_directory0 = '/var/lib/postgresql/9.3/main'<br>
    backend_flag0 = 'ALLOW_TO_FAILOVER'<br>
    backend_hostname1 = 'dbnode2'<br>
    backend_port1 = 5432<br>
    backend_weight1 = 1<br>
    backend_data_directory1 = '/var/lib/postgresql/9.3/main'<br>
    backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
    enable_pool_hba = on<br>
    pool_passwd = 'pool_passwd'<br>
    authentication_timeout = 10<br>
    ssl = off<br>
    num_init_children = 8<br>
    max_pool = 4<br>
    child_life_time = 300<br>
    child_max_connections = 0<br>
    connection_life_time = 0<br>
    client_idle_limit = 0<br>
    log_destination = 'stderr'<br>
    print_timestamp = on<br>
    log_connections = on<br>
    log_hostname = on<br>
    log_statement = off<br>
    log_per_node_statement = off<br>
    log_standby_delay = 'none'<br>
    syslog_facility = 'LOCAL0'<br>
    syslog_ident = 'pgpool'<br>
    debug_level = 1<br>
    pid_file_name = '/var/run/pgpool/pgpool.pid'<br>
    logdir = '/tmp'<br>
    connection_cache = off<br>
    reset_query_list = 'ABORT; DISCARD ALL'<br>
    replication_mode = off<br>
    replicate_select = off<br>
    insert_lock = on<br>
    lobj_lock_table = ''<br>
    replication_stop_on_mismatch = off<br>
    failover_if_affected_tuples_mismatch = off<br>
    load_balance_mode = off<br>
    ignore_leading_white_space = on<br>
    white_function_list = ''<br>
    black_function_list = 'nextval,setval'<br>
    master_slave_mode = on<br>
    master_slave_sub_mode = 'stream'<br>
    sr_check_period = 5<br>
    sr_check_user = 'repmgr'<br>
    sr_check_password = ''<br>
    delay_threshold = 0<br>
    follow_master_command = ''<br>
    parallel_mode = off<br>
    pgpool2_hostname = ''<br>
    system_db_hostname  = 'localhost'<br>
    system_db_port = 5432<br>
    system_db_dbname = 'pgpool'<br>
    system_db_schema = 'pgpool_catalog'<br>
    system_db_user = 'pgpool'<br>
    system_db_password = ''<br>
    health_check_period = 5<br>
    health_check_timeout = 30<br>
    health_check_user = 'repmgr'<br>
    health_check_password = ''<br>
    health_check_max_retries = 3<br>
    health_check_retry_delay = 10<br>
    failover_command = 'su postgres -c "ssh postgres@%H repmgr -f
    /var/lib/postgresql/9.3/repmgr/repmgr.conf --verbose standby
    promote"'<br>
    failback_command = ''<br>
    fail_over_on_backend_error = on<br>
    search_primary_node_timeout = 10<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>
    use_watchdog = false<br>
    trusted_servers = ''<br>
    ping_path = '/bin'<br>
    wd_hostname = 'dbnode1'<br>
    wd_port = 9000<br>
    wd_authkey = ''<br>
    delegate_IP = '10.5.4.241'<br>
    ifconfig_path = '/sbin'<br>
    if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0'<br>
    if_down_cmd = 'ifconfig eth0:0 down'<br>
    arping_path = '/usr/sbin'           # arping command path<br>
    arping_cmd = 'arping -U $_IP_$ -w 1'<br>
    clear_memqcache_on_escalation = on<br>
    wd_escalation_command = ''<br>
    wd_lifecheck_method = 'heartbeat'<br>
    wd_interval = 3<br>
    wd_heartbeat_port = 9694<br>
    wd_heartbeat_keepalive = 2<br>
    wd_heartbeat_deadtime = 30<br>
    heartbeat_destination0 = 'dbnode2'<br>
    heartbeat_destination_port0 = 9694<br>
    heartbeat_device0 = ''<br>
    wd_life_point = 3<br>
    wd_lifecheck_query = 'SELECT 1'<br>
    wd_lifecheck_dbname = 'template1'<br>
    wd_lifecheck_user = 'repmgr'<br>
    wd_lifecheck_password = ''<br>
    other_pgpool_hostname0 = 'dbnode2'<br>
    other_pgpool_port0 = 9999<br>
    other_wd_port0 = 9000<br>
    relcache_expire = 0<br>
    relcache_size = 256<br>
    check_temp_table = on<br>
    memory_cache_enabled = off<br>
    memqcache_method = 'shmem'<br>
    memqcache_memcached_host = 'localhost'<br>
    memqcache_memcached_port = 11211<br>
    memqcache_total_size = 67108864<br>
    memqcache_max_num_cache = 1000000<br>
    memqcache_expire = 0<br>
    memqcache_auto_cache_invalidation = on<br>
    memqcache_maxcache = 409600<br>
    memqcache_cache_block_size = 1048576<br>
    memqcache_oiddir = '/var/log/pgpool/oiddir'<br>
    white_memqcache_table_list = ''<br>
    black_memqcache_table_list = ''<br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <div style="margin:15px 0 0 0; font-family: 'Lucida Sans Unicode',
        'Lucida Grande', arial, sans-serif; color: #282828; line-height:
        1.5em; font-size: 11px;">
        <b style="font-size: 13px;">Martin</b></div>
    </div>
  </body>
</html>