[pgpool-general: 4431] Pgpool master-slave mode

Dmitry Voronin carriingfate92 at yandex.ru
Wed Feb 10 17:03:04 JST 2016


Hello, 

I'm using pgpool2 3.3.4 and I have a question about master-slave mode On Ubuntu 14.04.

So, I have 2 PostgreSQL clusters (I use PostgreSQL 9.4.5), which are set in streaming replications (master node on port 5432 and slave node on 5433).
Next, I set params in pgpool.conf:

backend_hostname0 = '127.0.0.1'
backend_port0 = 5432
backend_weight0 = 0.5
backend_data_directory0 = '/var/lib/postgresql/9.4/master'

backend_hostname1 = '127.0.0.1'
backend_port1 = 5433
backend_weight1 = 0.5
backend_data_directory1 = '/var/lib/postgresql/9.4/master'

master_slave_mode = on
master_slave_sub_mode = 'stream'

port = 6000

Next, I connect to pgpool on port 6000 via psql:

psql -h 127.0.0.1 -p 6000 

and execute SHOW pool_nodes;

I have results:

 node_id | hostname  | port | status | lb_weight |  role
---------+-----------+------+--------+-----------+---------
 0       | 127.0.0.1 | 5432 | 2      | 0.500000  | standby
 1       | 127.0.0.1 | 5433 | 2      | 0.500000  | standby
 (2 rows)

So, the questions are:
 - Why pgpool determines all nodes as stanby?
 - In this case I can't execute DDL statetements like CREATE TABLE ... because I have error: In transaction "read only" can not execute CREATE TABLE

-- 
Best regards, Dmitry Voronin


More information about the pgpool-general mailing list