Can someone help me in my simple pgpool replication?

Objective: To implement simple postgres database replication using Pgpool
Versions used : Postgres 9.2.4 , Pgpool 3.2

(1) I have created two Centos Virtual machines on my laptop- Centos32, and CentOS32A. Their hostnames are ‘localhost’ and ‘laserga.wipro.tcpn.com’ (as provided by hostname command and Their IPs are 192.168.2.128, and ‘192.168.2.129 ‘ respectively. (as provided by ifconfig command).

(2) I installed Postgres 9.2.4 and Pgpool 3.2 on both machines successfully.

(3) I configured pgpool config files and pcp.conf and pgpool.conf for basic replication. As shown at the end. And restarted the machine.

(4) As ‘postgres’ user I have created a small database : yash01 on both the hosts. Then created a schema and table ‘sch1.tab1 (aa int)’. Inserted 5 integers (1,2, 3, 4, 5) in the table on both the machines.

(5) I start the pgpool on host1 – ‘localhost’. I verify that pgpool started correctly by looking at xxx.pid and xxx.log files. And then doing ps –ef and verifying that pgpool and child processes are running.

(6) On machine one – ‘Localhost’, I insert 5 additional rows in ‘tab1’ in the table (11, 12, 13, 14, 15). Commited it. And then checked it using select.

(7) I go and verify on machine 2 , ‘laserga.wipro.tcpn.com.’ whether the ‘tab1’ entries are replicated on it.

I find that it is NOT replicated. I want to know what mistake I am doing? Is there something more to be configured - in config files or soemewhere else? I have taken default files pcp.conf and pgpool.conf.sample-replication for replication and made the changes as follows. I did not make any changes to the default database config file.


Pgpool.conf file changes:

# - pgpool Connection Settings -
#listen_addresses = 'localhost'
listen_addresses = '*'
port = 9999
socket_dir = '/tmp'


# - pgpool Communication Manager Connection Settings -
pcp_port = 9898
pcp_socket_dir = '/tmp'


# - Backend Connection Settings –
# - Backend Connection Settings -

#backend_hostname0 = 'localhost'
backend_hostname0 = '192.168.2.128'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/pgsql/9.2/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
# Controls various backend behavior
# ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER

#backend_hostname1 = 'laserga'
backend_hostname1 = '192.168.2.129'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/pgsql/9.2/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'

# - Authentication -
enable_pool_hba = off

# - SSL Connections -
ssl = off

# - Pool size -
num_init_children = 8
max_pool = 4

#------------------------------------------------------------------------------
# CONNECTION POOLING
#------------------------------------------------------------------------------
connection_cache = off

#------------------------------------------------------------------------------
# REPLICATION MODE
#------------------------------------------------------------------------------
replication_mode = on
replicate_select = off
insert_lock = on
lobj_lock_table = ''
replication_stop_on_mismatch = off
failover_if_affected_tuples_mismatch = off

#------------------------------------------------------------------------------
# LOAD BALANCING MODE
#------------------------------------------------------------------------------
load_balance_mode = off