Common PostgreSQL Replication Errors with PGPool

Error 1: BACKENDERROR

  1. Check /etc/hosts file for correct entries.
  2. Check which node is Primary (10.0.90.1 – in my case )and Secondary (10.0.90.2 – in my case) by using show pool_node or by using ifconfig (check which ifconfig has 10.0.90.1 listed, that is the one which will accept connections first after pgpool re-start) then on both the nodes , run tail -f /var/log/pgpool/pgpool.log
  3. If on primary it is showing “refused connection or can’t accept connections etc,) also check standby for any errors in this file.
  4. then stop pgpool and postgres service on standby then stop ONLY pgpool service on primary and restart pgpool service first on primary and then restart the services on standby.
  5. Check psql -p9999 -h10.0.90.1 …… ” on standby. This will work even if services are not started on standby as it will point to VIP.

Error 2: PGPOOL DEAD BUT SUBSYS LOCKED

Solution: delete the file under /var/lock/ for subsys for pgpool.

[root@pg]# mkdir subsys.old
[root@pg]# ls -l
drwxr-xr-x. 2 root root 4096 Jan 9 09:52 subsys
drwxr-xr-x 2 root root 4096 Feb 23 04:54 subsys.old
[root@pg]# cd subsys
[root@pg]# mv * /var/lock/subsys.old

Error 3: BOTH NODES WENT TO STANDBY

1. Stop pgpool and then postgres service on standby then stop pgpool and then postgres service on primary

service postgresql-9.3 start
service pgpool start

2. Start Postgres service first and then pgpool on Primary.

3. Start Postgres service first and then pgpool on Secondry.

service postgresql-9.3 start
service pgpool start

Error 4: POSTGRESQL SERVICE DOESNOT STOP

Below are the step which can be used to stop PostgreSQL:

a. service postgresql-9.3 stop
b. /etc/init.d/postgresql-9.3 stop
c. su - postgres
pg_ctl -m fast stop

Leave a Reply