Step by step configuration setup load balancing and replication postgresql with pgpool.
1. Install Postgresql
install both on 192.168.112.142 and 192.168.112.140
# sed -i '7iexclude=postgresql*' /etc/yum.repos.d/public-yum-ol6.repo
# rpm -ivh http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
# yum install postgresql92 postgresql92-libs postgresql92-server postgresql92-devel
# chkconfig postgresql-9.2 on
# service postgresql-9.2 initdb
# service postgresql-9.2 start
2. Edit /etc/hosts on each server
192.168.112.142 postgres1
192.168.112.140 postgres2
192.168.112.141 pgpserv
3. Edit postgresql.conf
nano /var/lib/pgsql/9.2/data/postgresql.conf
modify listen_address and port
listen_addresses = '*'
port = 5432
4. Edit pg_hba.conf
Change all method to trust
Restart service postgresql to take effect
[root@postgres1 ~]# /etc/init.d/postgresql-9.2 restart
Stopping postgresql-9.2 service: [ OK ]
Starting postgresql-9.2 service: [ OK ]
Next : Part 2 http://willyristanto.blogspot.com/2014/10/clustering-postgresql-with-pgpool-ii-92_15.html
0 comments:
Post a Comment