[pgsql-jp: 32370] Re: pgpoolをうまく動かせない

Tatsuo Ishii t-ishii @ sra.co.jp
2004年 2月 26日 (木) 17:18:49 JST


石井です.

> > すみません.pgpoolはまだ7.4に対応していません.できれば7.3で検証してい
> > ただけないでしょうか.
> 
> あぁ、、、そうなんですね。
> 石井さんのpgpoolのページに7.4について触れられていなかったので
> 嫌な予感はしていたのですけれどね。(笑

時間があればすぐにでも対応できるのですが.
# 明日からはJPUGのセミナーで札幌に行かなければならないし,原稿はたまってる
# し,年度末の雑務が山積みだし...

> 「環境3」
> OS: Debian/Sarge
> Kernel: Linux2.6.0
> RAM: 256MB
> PostgreSQL: 7.3.4(debパッケージ, pg_hba.conf: localのみtrust@テスト前)
> pgpool: 0.1.8
> 
> ↑の状態ですと、
> $ psql -Uwww-data -p9999 test
> psql: server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request.
> 
> (DEBUGメッセージ)← (pgpool -d -n)
> DEBUG: pid 28438: I am 28438
> DEBUG: pid 28373: failover_handler called
> DEBUG: pid 28389: I am 28389 accept fd 5
> DEBUG: pid 28389: Protocol Version: 00020000
> DEBUG: pid 28389: Protocol Major: 2 Minor:0
> DEBUG: pid 28389: database: test
> DEBUG: pid 28389: user: www-data
> DEBUG: pid 28389: ::
> ERROR: pid 28389: connect_unix_domain_socket: connect() failed: No such file
> or directory
> DEBUG: pid 28754: I am 28754
> DEBUG: pid 28721: failover_handler called
> 
> になってしまいます。無論、
> $ psql -Uwww-data test
> なら接続可能です。

うーん,手元のVine Linux 2.6では快調に動いているんですけどね.

pool_connection_pool.cの323行目あたりに

snprintf(addr.sun_path, sizeof(addr.sun_path),"/tmp/.s.PGSQL.%d", pool_config.current_backend_port);

というのがあると思いますが,その下に

pool_debug("connecting postmaster Unix domain socket: %s", addr.sun_path);

を入れて,実際にはどのようなソケットに接続しようとしているのか見れば,
何か分かるかも知れません.

> 仕方ないので、TCP/IP経由でlocalhost向け接続を許可したら接続可能になりまし
> た。
> [junnichi @ mouse postgresql]$ psql -Uwww-data -p9999 test
> Welcome to psql 7.3.4, the PostgreSQL interactive terminal.
> 
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help on internal slash commands
>        \g or terminate with semicolon to execute query
>        \q to quit
> 
> test=> \q
> 
> ところが、 psql -l を使おうとするとこれまた接続不能です。
> [junnichi @ mouse postgresql]$ psql -Uwww-data -p9999 -l
> psql: Sorry, too many clients already
> 
> (DEBUGメッセージ)
> DEBUG: pid 27916: I am 27916 accept fd 5
> DEBUG: pid 27916: Protocol Version: 00020000
> DEBUG: pid 27916: Protocol Major: 2 Minor:0
> DEBUG: pid 27916: database: template1
> DEBUG: pid 27916: user: www-data
> ERROR: pid 27916: do_child: cannot not create backend connection

これは,testとtemplate1の2つのDBにアクセスしているからです.設定ファイ
ルの,max_pool を2以上にすれば大丈夫なはずです.
--
Tatsuo Ishii



pgsql-jp メーリングリストの案内