0

I'm trying to configure pgpool to use load balance between two servers (Both running Debian 8.2 and Postgresql 9.4). I already have Streaming Replication working between the two (Master in 153 and Slave in 155). Now I installed PgPool and configured with the two servers:

backend_hostname0 = '10.0.0.153'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/postgresq/9.4/main'

backend_hostname1 = '10.0.0.155'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/postgresq/9.4/main'

and configure pool_hba, pool_passwd, and load_balance_mode is on. My problem is: When i try to use psql via pgpool it displays an error: "psql: FATAL: password authentication failed for user 'postgres'"

BUT if I comment all the section of backend1, changing nothing more, and restart the pgpool2 service, I can connect without problem, in the same machine, using the exact same user and password. I don't know if there's another parameter that I should set in order to use two servers and load balance between them.

I can connect to each backend server from each client with psql just fine, so credentials shouldn't be the problem.

PS: Don't know if that helps. But in pgpool.conf, the replication_mode is off, because I'm using the Streaming Replication, and as far as I heard, it's possible to use load_balance without making replication via pgpool.

Thanks.

2 Answers2

0

Try to login to pgppol server and run the command: pg_md5 -m -u postgres your_password_for_postgres_user

Now see the content of pool_passwd. It should contain something like:

postgres:md55ebe2294ecd0e0f08eab7690d2a6ee69

Now restart your pgpool and try to connect again. Hopefully your problem will be resolved.

0

pgpool's load balancing can be used with streaming replication, for that you need to set master_slave_mode and load_balance_mode to true and also set master_slave_sub_mode to stream.

For the authentication error you are getting, check the pg_hba.conf settings for pgpool host. And depending on the type of authentication method specified see the respective client authentication section in the pgpool documentation.

http://www.pgpool.net/docs/latest/pgpool-en.html#hba

Muhammad Usama
  • 2,797
  • 1
  • 17
  • 14