[pgpool-general-jp: 346] Re: 答えが変わる

スクゥ 陶山 泰 suyama @ skoo.co.jp
2008年 1月 2日 (水) 16:37:08 JST


こんにちは。陶山です。

 pgpool-II 2.0.2 を正常に起動できない点についてもう少ししつこくテスト
してみました。


 バックエンドのポートを変更しても pgpool-II は常に .s.PGSQL.5432 を
Unix domain socket とみなしているようです。
 ポートを3通りに変えてテストしてみました。
 (A):5434、(B):5432、(C):5455
 結果は後載します。(起動したように見えますが log にエラーが現われます)

 起動しているプロセスをみてみると
postgres @ main:~$ ps ax | grep pgpool
 2331 ?        S      0:00 /usr/local/bin/pgpool -n -d
 2367 ?        S      0:00 pgpool: wait for connection request
起動しているように見えるので、psqlコマンドを実行してみました

postgres @ main:~$ psql -p 5439 -l
psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
というエラーです。このときのログも最後に掲載します。

 初めてpgpool を使おうとしているのでよくはわかりませんが、どうも
pgpool-II 2.0.2 自体の不具合ではないだろうかと思います。
 設定ファイルpgpool.conf や postgresql.conf は、pgpool-II 2.0.1
のときのものと同じです(ポート番号以外)


以下詳細情報です。
===================================
★実験(A)
■ポート設定
postgresql.conf   port= 5434
pgpool.conf       backend0_port0 = 5434

■main:~# ls -al /var/run/postgresql/
total 16
drwxrwsr-x  2 postgres postgres 4096 Jan  2 15:27 .
drwxr-xr-x 10 root     root     4096 Jan  2 15:27 ..
srwxrwxrwx  1 postgres postgres    0 Jan  2 15:27 .s.PGSQL.5434
-rw-------  1 postgres postgres   34 Jan  2 15:27 .s.PGSQL.5434.lock
srwxrwxrwx  1 root     postgres    0 Jan  2 15:27 .s.PGSQL.5439
-rw-------  1 postgres postgres    5 Jan  2 15:27 8.1-main.pid

■/var/log/postgresql/pgpool.log の一部
 DEBUG: pid 2328: key: backend_hostname0
 DEBUG: pid 2328: value: 'localhost' kind: 4
 DEBUG: pid 2328: key: backend_port0
 DEBUG: pid 2328: value: 5434 kind: 2
 DEBUG: pid 2328: key: backend_weight0
 DEBUG: pid 2328: value: 1 kind: 2
 DEBUG: pid 2328: key: backend_data_directory0
 DEBUG: pid 2328: value: '/etc/postgresql/8.1/main/pgdata' kind: 4

 LOG:   pid 2328: pgpool successfully started
 LOG:   pid 2328: starting health checking
 DEBUG: pid 2328: connecting postmaster Unix domain socket: /var/run/postgresql/.s.PGSQL.5432
 ERROR: pid 2328: connect_unix_domain_socket: connect() failed: No such file or directory
 ERROR: pid 2328: health check failed. master  at port 5432 is down
 DEBUG: pid 2328: failover_handler called
 LOG:   pid 2328: starting degeneration. shutdown master host (5432)

■Unix domain socket を
/var/run/postgresql/.s.PGSQL.5432
と間違って認識しているため、見つけられないでいる(ように見える)

=====================================
★実験(B)
■ポート設定
postgresql.conf   port= 5432
pgpool.conf       backend0_port0 = 5432

■main:~# ls -al /var/run/postgresql/
total 16
drwxrwsr-x  2 postgres postgres 4096 Jan  2 15:48 .
drwxr-xr-x 10 root     root     4096 Jan  2 15:48 ..
srwxrwxrwx  1 postgres postgres    0 Jan  2 15:48 .s.PGSQL.5432
-rw-------  1 postgres postgres   34 Jan  2 15:48 .s.PGSQL.5432.lock
srwxrwxrwx  1 root     postgres    0 Jan  2 15:48 .s.PGSQL.5439
-rw-------  1 postgres postgres    5 Jan  2 15:48 8.1-main.pid

■/var/log/postgresql/pgpool.log の一部
 DEBUG: pid 2328: key: backend_hostname0
 DEBUG: pid 2328: value: 'localhost' kind: 4
 DEBUG: pid 2328: key: backend_port0
 DEBUG: pid 2328: value: 5432 kind: 2
 DEBUG: pid 2328: key: backend_weight0
 DEBUG: pid 2328: value: 1 kind: 2
 DEBUG: pid 2328: key: backend_data_directory0
 DEBUG: pid 2328: value: '/etc/postgresql/8.1/main/pgdata' kind: 4

 LOG:   pid 2328: pgpool successfully started
 LOG:   pid 2328: starting health checking
 DEBUG: pid 2328: connecting postmaster Unix domain socket: /var/run/postgresql/.s.PGSQL.5432
 DEBUG: pid 2328: connected to postmaster Unix domain socket: /var/run/postgresql/.s.PGSQL.5432 fd: 8
 ERROR: pid 2328: health check failed during write. master  at port 5432 is down
 DEBUG: pid 2328: failover_handler called
 LOG:   pid 2328: starting degeneration. shutdown master host (5432)

Unix domain socket: /var/run/postgresql/.s.PGSQL.5432
を見つけたものの書き込みに失敗している(ように見える)

=====================================
★実験(C)
■ポート設定
postgresql.conf   port= 5455
pgpool.conf       backend0_port0 = 5455

■main:~# ls -al /var/run/postgresql/
total 16
drwxrwsr-x  2 postgres postgres 4096 Jan  2 15:58 .
drwxr-xr-x 10 root     root     4096 Jan  2 15:58 ..
srwxrwxrwx  1 root     postgres    0 Jan  2 15:58 .s.PGSQL.5439
srwxrwxrwx  1 postgres postgres    0 Jan  2 15:58 .s.PGSQL.5455
-rw-------  1 postgres postgres   34 Jan  2 15:58 .s.PGSQL.5455.lock
-rw-------  1 postgres postgres    5 Jan  2 15:58 8.1-main.pid

■/var/log/postgresql/pgpool.log の一部
 DEBUG: pid 2331: key: backend_hostname0
 DEBUG: pid 2331: value: 'localhost' kind: 4
 DEBUG: pid 2331: key: backend_port0
 DEBUG: pid 2331: value: 5455 kind: 2
 DEBUG: pid 2331: key: backend_weight0
 DEBUG: pid 2331: value: 1 kind: 2
 DEBUG: pid 2331: key: backend_data_directory0
 DEBUG: pid 2331: value: '/etc/postgresql/8.1/main/pgdata' kind: 4

 LOG:   pid 2331: starting health checking
 DEBUG: pid 2331: connecting postmaster Unix domain socket: /var/run/postgresql/.s.PGSQL.5432
 ERROR: pid 2331: connect_unix_domain_socket: connect() failed: No such file or directory
 ERROR: pid 2331: health check failed. master  at port 5432 is down
 DEBUG: pid 2331: failover_handler called
 LOG:   pid 2331: starting degeneration. shutdown master host (5432)

 実験(A)と同じようです。
===================================
★ psql -p 5439 -l のエラー時の pgpool.log

 DEBUG: pid 2398: I am 2398 accept fd 8
 DEBUG: pid 2398: Protocol Major: 3 Minor: 0 database: postgres user: postgres
 DEBUG: pid 2398: connecting postmaster Unix domain socket: /var/run/postgresql/.s.PGSQL.0
 ERROR: pid 2398: connect_unix_domain_socket: connect() failed: No such file or directory
 LOG:   pid 2398: notice_backend_error: master: 1 fail over request from pid 2398
 DEBUG: pid 2331: failover_handler called
 DEBUG: pid 2331: reap_handler called
 DEBUG: pid 2331: child 2398 exits with status 256 by signal 0
 DEBUG: pid 2581: I am 2581
 DEBUG: pid 2331: fork a new child pid 2581

 Unix domain socket を /var/run/postgresql/.s.PGSQL.0 と認識している
時点で怪しい



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