写于2013年秋,pgpool-II-3.3.1
下载pgpool-II-3.3.1.tar.gz文件,上传至服务器
1、安装
[hadoop@slave3 bin]$ tar zxvf pgpool-II-3.3.1.tar.gz
[hadoop@slave3 bin]$ mv pgpool-II-3.3.1 pgpool
[hadoop@slave3 bin]$ cd pgpool
[hadoop@slave3 bin]$ mkdir -p /dw/pgpool
[hadoop@slave3 pgpool]$ ./configure --prefix=/dw/pgpool
[hadoop@slave3 pgpool]$ make && make install
2、配置pgpool
[hadoop@slave3 pgpool]$ cd /dw/pgpool/etc
[hadoop@slave3 etc]$ cp pcp.conf.sample pcp.conf
[hadoop@slave3 etc]$ cp pgpool.conf.sample pgpool.conf
[hadoop@slave3 etc]$ cp pool_hba.conf.sample pool_hba.conf
[hadoop@slave3 etc]$ /dw/pgpool/bin/pg_md5 hive
8a4ac216fb230da3834de641b3e5d0f7
[hadoop@slave3 etc]$ vi pcp.conf
hive:8a4ac216fb230da3834de641b3e5d0f7
[hadoop@slave3 etc]$ vi pgpool.conf
listen_addresses = '*'
master_slave_mode = on
load_balance_mode = on
backend_hostname0 = 'slave3' # Host name or IP address to connect to for backend 0
backend_port0 = 5432 # Port number for backend 0
backend_weight0 = 1
backend_hostname1 = 'slave6'
backend_port1 = 5432
backend_weight1 = 1
memqcache_oiddir = '/dw/pgpool/oiddir'
pid_file_name = '/dw/pgpool/pgpool.pid'
log_destination = 'csvlog'
3、配置主
[hadoop@slave3 data]$ vi postgresql.conf
wal_level = hot_standby
max_wal_senders = 3
4、配置从
[hadoop@slave6 data]$ vi postgresql.conf
hot_standby = on