Search code examples
postgresqlpgpool

pcp_attach_node gives EOFError in pgpool


I have successfully setup replication for my Postgres database using pg_pool.

Then I stopped the master server and checked the pool status. It is as like below

postgres=# show pool_nodes;
 node_id |  hostname  | port | status | lb_weight |  role  
---------+------------+------+--------+-----------+--------
 0       | 10.140.0.9 | 5432 | 3      | 0.500000  | slave
 1       | 10.140.0.7 | 5432 | 2      | 0.500000  | master
(2 rows)

Then I started the server, but it still shows the same status for the slave. So I used the following command to start the node:

/usr/sbin/pcp_node_info 10 10.140.0.9 5432 postgres postgres 1

But it is giving "EOFError" error. Please help to solve this issue.

Or please let me know a way to bring back the status 2 from status 3?


Solution

  • I solved the issue myself. In configuration the pcp port is 9898. Also there should be no space before password in pcp.conf file.

    The pcp command should be as follows

    /usr/sbin/pcp_node_info 10 localhost 9898 postgres postgres 1