I am trying to implement replication and load balancing on my Ubuntu i686 athlon i386 GNU/Linux.for creating database clustures I have installed postgresql contrib
9.1.11 having initially database clusture in directory /var/lib/postgresql/9.1/main
.
By using initdb command i have created two other database clusters under directories /usr/local/pgsql/data
and /usr/local/pgsql/standby
under port 5433 and 5434 respectively. Changes in postgresql.conf
and pg_hba.conf
files of both clusters as follows:
In postgresql.conf
:
wal_level = hot_standby
hot_standby = on
log_destination = 'stderr'
logging_collector = on
log_statement = 'all'
In pg_hba.conf
:
local all all trust
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
host all all 0.0.0.0/0 md5
local replication postgres trust
host replication postgres 127.0.0.1/32 trust
host replication postgres ::1/128 trust
After that I have installed pgpool to by command sudo apt-get install pgpool2
.
This installation create directory in /etc/pgpool
containing files as follows
pgpool.conf
pool_hba.conf
pcp.conf
Changes pgpool.conf
as follows:
listen_addresses = '*'
port = 9999
backend_hostname0 = 'localhost'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/postgresql/9.1/main'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_hostname1 = 'localhost'
backend_port1 = 5433
backend_weight1 = 1
backend_data_directory1 = '/var/local/pgsql/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_hostname2 = 'localhost'
backend_port0 = 5434
backend_weight0 = 1
backend_data_directory0 = '/var/local/pgsql/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
pool_hba.conf
file as follows:
local all all trust
host all all 127.0.0.1/32 trust
Make entry in pcp.conf of postgresql user with md5 password. restart pgpool /etc/init.d/pgpool2 start command and it started.
But when i am trying to use command psql -p 9999
then it throws error as follows:
bpsql: ERROR: MD5 authentication is unsupported in replication, master-slave and parallel modes.
HINT: check pg_hba.conf**.
I have lot of googlee but I am not getting any solution. Please help me to find solution and suggest me if I am doing anything wrong.