I'm experimenting with PostgreSQL and pgpool-II and trying to setup native replication mode on pgpool. The pgpool documentation says
In the native replication mode, Pgpool-II is responsible for synchronizing databases.. So I didn't change any configuration on PostgreSQL, just set up two nodes via Puppet, made proper firewall configuration, so I can directly connect to nodes from other hosts on the network. pgpool-II logs seem Ok, don't show any obvious errors and pgpool starts normally, it can even connect to one of the nodes Actually it always connects to
backend_hostname0. I even don't see any messages about replication itself. And when I stop the
backend_hostname0 it seems like it doesn't see my second node and says:
DETAIL: all backend nodes are down, pgpool requires at least one valid node.
My pgpool configuration is like the following (I just copied that standard example config and added my posgresql backends):
replication_mode = on backend_hostname0 = 'pg2.example.com' backend_port0 = 5432 backend_weight0 = 1 backend_data_directory0 = '/var/postgres/data' backend_flag0 = 'ALLOW_TO_FAILOVER' backend_hostname1 = 'localhost' backend_port1 = 5432 backend_weight1 = 1 backend_data_directory1 = '/var/postgres/data' backend_flag1 = 'ALLOW_TO_FAILOVER'
Maybe I missed something, can't get this thing to work. Thank you in advance.