Sep 8, 2011

postgresql replication with pgpool2 on ubuntu

next capter from may last post, now we'll make repication of postgreSQL with pgpool on ubuntu. assumtion, we have 2 server with postgresql installed ( n running well ) on each server.
 first install pgpooll2, with
sudo apt-get install pgpool2
 edit config file on /etc/pgpool.conf
# Host name or IP address to listen on: '*' for all, '' for no TCP/IP
# connections
listen_addresses = '*'

# Port number for pgpool
port = 5433

# Port number for pgpool communication manager
pcp_port = 9898

parallel_mode = false

# Replication mode
replication_mode = true

# Load balancing mode, i.e., all SELECTs are load balanced.
# This is ignored if replication_mode is false.
load_balance_mode = true

backend_hostname0 = ''
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = ''
backend_hostname1 = ''
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = ''
edit config file on /etc/pcp.conf Append the following line
#postgres is user of your postgresql 
#and ee26005a83e958c15.. bla... bla... is postgres password in md5.
      to get/convert password in md5, you can use this ex command :
               PG1:~$ pg_md5 your_pass
 restart the service
/etc/init.d/postgresql restart
 /etc/init.d/pgpool2 restart
--cek 'n jajal--
 create database on pgpool port
createdb db_test –p 9898 –h –U postgres
If replication is working properly, in both machines a new database called “db_test” should be created. use this command to check it up:
$ psql –l –p 5432 –h –U postgres
$ psql –l –p 5432 –h –U postgres

next chapter : .: here:.
source :


Post a Comment

comment please ...