-# yum install -y deltarpm
-# yum install -y openssl-devel zlib-devel readlinie-devel gcc-c++ libevent-devel
-# ./configure --prefix=/opt/pgbouncer/1.8.1
-# make
-# make install
-# cd /opt/pgbouncer/1.8.1/
-# mkdir log etc run
-# ls
bin etc log run share
-#
-# cp share/doc/pgbouncer/pgbouncer.ini etc/
-# cp share/doc/pgbouncer/userlist.txt etc/
-#
-# vi /opt/pgbouncer/1.8.1/etc/pgbouncer.ini
-#### modify ####
[databases]
-#### total_pool_size = pool_size + reserve_pool_size ####
testdb = port=5432 dbname=testdb pool_size=2 user=testuser password=testuser
[pgbouncer]
logfile = /opt/pgbouncer/1.8.1/log/pgbouncer.log
pidfile = /opt/pgbouncer/1.8.1/run/pgbouncer.pid
listen_addr = 0.0.0.0
auth_type = md5
auth_file = /opt/pgbouncer/1.8.1/etc/userlist.txt
admin_users = pgbadmin
pool_mode = transaction
server_reset_query = RESET ALL
server_reset_query_always = 1
ignore_startup_parameters = extra_float_digits
max_client_conn = 1000
default_pool_size = 2
min_pool_size = 1
reserve_pool_size = 1
pkt_buf = 8192
listen_backlog = 65535
-# vi /opt/pgbouncer/1.8.1/etc/userlist.txt
"pgbadmin" "pgbouncer"
"user01" "user01"
日志配置
-# vi /etc/logrotate.d/pgbouncer
/opt/pgbouncer/1.8.1/log/pgbouncer.log
{
rotate 10
missingok
sharedscripts
notifempty
nocompress
daily
create 0640 postgres postgres
postrotate
/bin/kill -HUP cat /opt/pgbouncer/1.8.1/run/pgbouncer.pid 2> /dev/null
2>/dev/null ||true
endscript
}
-#
原文地址:http://blog.51cto.com/heyiyi/2118290