I am trying to run pgpool on 2+ web servers which also have a rails app, etc. The idea is to have replication via slony or streaming and failover via pgpool. It would also be nice to have queries balanced to the replca, and web server connections pooled but the important thing is to get master_slave and failover working.
I installed pgpool version 3.4.1(lainihi), from apt packages on Ubuntu 10.04 LTS. db01 is the master and gets replicated to db02 via slony. My pgpool.conf looks like this:
# configure frontend
listen_addresses = 'localhost'
port = 5432
# configure the backends
backend_host_name = 'db01'
backend_port = 5432
secondary_backend_host_name = 'db02'
secondary_backend_port = 5432
# uncomment this and pgpool fails to connect
#master_slave_mode = true
#master_slave_sub_mode = 'slony'
It works right now in "raw mode" and I wonder if I will gain much with master_slave? Anyway if I uncomment the master_slave=true I get the folling when I connect:
# psql -h localhost -U XXX -W
Password for user XXX:
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
in the pgpool log I see the following
2011-01-13 02:03:17 DEBUG: pid 24144: I am 24144 accept fd 6
2011-01-13 02:03:17 DEBUG: pid 24144: Protocol Major: 1234 Minor: 5679 database: user:
2011-01-13 02:03:17 DEBUG: pid 24144: SSLRequest: sent N; retry startup
2011-01-13 02:03:17 DEBUG: pid 24144: Protocol Major: 3 Minor: 0 database: XXX user: XXX
2011-01-13 02:03:17 DEBUG: pid 24147: I am 24147 accept fd 6
2011-01-13 02:03:17 DEBUG: pid 24147: Protocol Major: 3 Minor: 0 database: XXX user: XXX
2011-01-13 02:03:17 DEBUG: pid 24144: pool_read_message_length: lenghth: 12
2011-01-13 02:03:17 DEBUG: pid 24144: trying md5 authentication
2011-01-13 02:03:17 DEBUG: pid 24144: master: 1 salt: 8bcce867
2011-01-13 02:03:17 DEBUG: pid 24147: pool_read_message_length: lenghth: 12
2011-01-13 02:03:17 DEBUG: pid 24147: trying md5 authentication
2011-01-13 02:03:17 DEBUG: pid 24147: master: 1 salt: bb5f7a63
2011-01-13 02:03:17 DEBUG: pid 24144: master: 0 salt: 5abb8e55
2011-01-13 02:03:17 DEBUG: pid 24144: do_md5: backend does not return R while processing MD5 authentication E
2011-01-13 02:03:17 ERROR: pid 24144: pool_do_auth: backend does not return authenticaton ok
2011-01-13 02:03:17 DEBUG: pid 24147: master: 0 salt: 4c1e5953
2011-01-13 02:03:17 DEBUG: pid 24147: do_md5: backend does not return R while processing MD5 authentication E
2011-01-13 02:03:17 ERROR: pid 24147: pool_do_auth: backend does not return authenticaton ok
It seems like pgpool cannot authenticate with the backend, but I can connect to each backend server from each client with psql just fine, and as I said pgpool works in "raw mode".
Any help getting pgpool configured would be greatly appreciated. It looks like a great solution, but getting it set up has been more difficult than expected.
TIA,
Dennis