スタンドアロンの postgresql サーバーで pgbouncer を動作させようとしていますが、pgbouncer ポートを使用してデータベースに接続しようとすると、タイムアウト エラーが発生します。
Postgresql: 9.1.8
pgBouncer: 1.4.2
OS: Ubuntu 12.04.2 LTS (GNU/Linux 3.8.4-x86_64-linode31 x86_64)
これが私のconfファイルです:
[databases]
postgres = host=127.0.0.1 port=5432 dbname=postgres
mydb = host=127.0.0.1 port=5432 dbname=mydb
[pgbouncer]
logfile = /home/username/pg_log/pgbouncer.log
pidfile = /tmp/pgbouncer.pid
listen_addr = xxx.xxx.xxx.xxx
listen_port = 6432
unix_socket_dir = /var/run/postgresql
auth_type = md5
auth_file = /etc/pgbouncer/userlist.txt
admin_users = postgres
stats_users = stats, root
user = postgres
pool_mode = session
server_reset_query = DISCARD ALL
max_client_conn = 1000
default_pool_size = 20
log_connections = 1
log_disconnections = 1
log_pooler_errors = 1
次のように接続をテストしようとしています:
psql -p 6432 -U postgres mydb
ここに私のログファイルがあります:
28396 LOG listening on xxx.xxx.xxx.xxx:6432
28396 LOG listening on unix:/var/run/postgresql/.s.PGSQL.6432
28396 LOG process up: pgbouncer 1.4.2, libevent 2.0.16-stable (epoll), adns: evdns2
28864 LOG C-0x23f7890: mydb/postgres@unix:6432 login attempt: db=mydb user=postgres
28864 LOG C-0x23f7890: mydb/postgres@unix:6432 closing because: client unexpected eof (age=0)
28864 LOG C-0x23f7890: mydb/postgres@unix:6432 login attempt: db=mydb user=postgres
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 new connection to server
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 closing because: connect failed (age=0)
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 new connection to server
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 closing because: connect failed (age=0)
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 new connection to server
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 closing because: connect failed (age=0)
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 new connection to server
28864 LOG S-0x2415240: mydb/postgres@127.0.0.1:5432 closing because: connect failed (age=0)
28864 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
28864 LOG C-0x23f7890: mydb/postgres@unix:6432 closing because: client_login_timeout (server down) (age=60)
28864 WARNING C-0x23f7890: mydb/postgres@unix:6432 Pooler Error: client_login_timeout (server down)
28864 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
28864 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
pgbouncer を機能させるために他に変更する必要があるものはありますか?