">

PGPOOL-II-12 INSTALLATION AND CONFIGURATION FOR POSTGRESQL DATABASE

PGPOOL-II-12 INSTALLATION AND CONFIGURATION FOR POSTGRESQL DATABASE

Hi,

We are installing pgpool with the following commands in pgpool machine.

  • sudo yum install pgpool-II-12
  • sudo yum install pgpool-II-12-extensions

We are executing commands in the following order.

  • cd /etc/pgpool-II-12
  • cp pgpool.conf.sample-master-slave pgpool.conf
We must change parameter as follows in pgpool.conf file.
  • listen_addresses = '*'
  • backend_hostname0 = 'pg' --your Primary  Postgresql database machice hostname
  • backend_port0 = 5432
  • backend_weight0 = 1
  • backend_data_directory0 = '/var/lib/pgsql/12/data'--data path
  • backend_flag0 = 'ALLOW_TO_FAILOVER'

 

  • backend_hostname1 = 'pgreplication'--your Repliation Postgresql database machice hostname
  • backend_port1 = 5432
  • backend_weight1 = 0
  • backend_data_directory1 = '/var/lib/pgsql/12/data' --data path
  • backend_flag1 = 'ALLOW_TO_FAILOVER'
 
  • pool_passwd = ''
  • pid_file_name = '/var/run/pgpool-II-12/pgpool.pid'
  • master_slave_sub_mode = 'stream'
We are execute below commands.
  • cp pool_hba.conf.sample pool_hba.conf
We are adding below line in pool_hba.conf file. 
  • host    all         all         0.0.0.0/0          md5
We are adding below line in master and replication pg_hba.conf file.(if you want add specific ip instead of "0.0.0.0").
  • host    all         all         0.0.0.0/0          md5
We are connecting master and replication database and we are executing below select.
  • select pg_reload_conf();
Last step is restart pgpool service.
  • sudo systemctl restart pgpool-II-12.service
Now, we can connect database via pgpool machine, and be careful,pgpool default port number is 9999.
 
Best Regards,
Engin YILMAZ.

 

Yorumlar

Henüz yorum yapılmadı.

Yorum Yapın