[pgpool-general-jp: 914] 切り離しの原因究明の方法について

小泉達也 koitatu @ gmail.com
2011年 4月 7日 (木) 13:31:47 JST


お世話になります。小泉と申します。

現在以下の構成で運用しています。
CentOS release 5.2 (Final)
httpd-2.2.10-1
tomcat5-5.5.23
pgpool-II-2.1-15
postgresql-8.3.6
一台の物理サーバでpostgresをポートを変えて2つ起動し、冗長化しています。
※ポート5433(マスタ)、5434(スレーブ)。
一台で、2つのpostgresを動作させている理由としては、冗長化により耐障害性
を高めるためです。

先日、マスタ側がpgpoolから切り離されました。
マスタ側が切り離された原因を追っていますが、DBの不整合が原因なのかDBから
の応答がなかったのか、切り分けが出来ていない状態です。

マスタ側が切り離された時のpgpoolのログは以下になります。
-------------------------------------------------------------------------------------
pgpool: 2011-04-07 04:02:16 LOG: pid 9939: connection received:
host=localhost.localdomain port=37825
pgpool: 2011-04-07 04:02:16 LOG: pid 9939: statement: set
client_encoding to 'LATIN1'
pgpool: 2011-04-07 04:02:16 LOG: pid 9939: statement: SELECT forw_addr
FROM aliases WHERE alias='root'
pgpool: 2011-04-07 04:02:16 LOG: pid 9939: statement: SELECT forw_addr
FROM aliases WHERE alias='owner-root'
pgpool: 2011-04-07 04:02:17 LOG: pid 10879: notice_backend_error: 0 fail
over request from pid 10879
pgpool: 2011-04-07 04:02:17 LOG: pid 18594: starting degeneration.
shutdown host localhost(5433)
pgpool: 2011-04-07 04:02:17 LOG: pid 18594: failover_handler: set new
master node: 1
pgpool: 2011-04-07 04:02:17 LOG: pid 18594: failover done. shutdown host
localhost(5433)
-------------------------------------------------------------------------------------

その際のpostgresqlのログは以下の通りです。
マスタ
-------------------------------------------------------------------------------------
04:02:16 postgres[10723]: [3-1] LOG:  unexpected EOF within message
length word
04:02:17 postgres[29102]: [8-1] FATAL:  terminating connection due to
administrator command
04:02:17 postgres[13997]: [11-1] LOG:  unexpected EOF on client connection
04:02:17 postgres[28330]: [6-1] LOG:  unexpected EOF on client connection
04:02:17 postgres[10196]: [2-1] LOG:  unexpected EOF on client connection
04:02:17 postgres[10717]: [2-1] LOG:  unexpected EOF on client connection
04:02:17 postgres[10270]: [2-1] LOG:  unexpected EOF on client connection
04:02:17 postgres[10265]: [2-1] LOG:  unexpected EOF on client connect
-------------------------------------------------------------------------------------

スレーブ
-------------------------------------------------------------------------------------
04:02:16 postgres2[10724]: [3-1] LOG:  unexpected EOF within message
length word
04:02:17 postgres2[28331]: [3-1] LOG:  unexpected EOF on client connection
04:02:17 postgres2[13996]: [9-1] LOG:  unexpected EOF on client connection
04:02:17 postgres2[10718]: [2-1] LOG:  unexpected EOF on client connection
04:02:17 postgres2[29103]: [7-1] LOG:  unexpected EOF on client connection
04:02:17 postgres2[10197]: [2-1] LOG:  unexpected EOF on client connection
04:02:17 postgres2[10271]: [2-1] LOG:  unexpected EOF on client connection
04:02:17 postgres2[10266]: [2-1] LOG:  unexpected EOF on client connection
-------------------------------------------------------------------------------------

pgpoolの設定ファイル
-------------------------------------------------------------------------------------
listen_addresses = '*'
port = 9999
pcp_port = 9898
socket_dir = '/tmp'
pcp_socket_dir = '/tmp'
backend_socket_dir = '/tmp'
pcp_timeout = 10
num_init_children = 220
child_life_time = 300
child_max_connections = 440
client_idle_limit = 0
authentication_timeout = 60
logdir = '/var/log/pgpool'
replication_mode = true
replication_timeout = 5000
load_balance_mode = true
replication_stop_on_mismatch = false
replicate_select = false
print_timestamp = true
master_slave_mode = false
connection_cache = true
health_check_timeout = 20
health_check_period = 1
health_check_user = 'postgres'
failback_command = ''
insert_lock = false
ignore_leading_white_space = true
log_statement = true
log_connections = true
log_hostname = true
parallel_mode = false
enable_query_cache = false
pgpool2_hostname = 'uname -nの結果と同様のもの'
backend_hostname0 = 'localhost'
backend_port0 = 5433
backend_weight0 = 1
backend_data_directory0 = '/var/lib/pgsql/data'
backend_hostname1 = 'localhost'
backend_port1 = 5434
backend_weight1 = 1
backend_data_directory1 = '/var/lib/pgsql/data2'
enable_pool_hba = true
-------------------------------------------------------------------------------------

【質問】
1.04:02:16に実行されたSELECT文が切り離されたきっかけという認識で正しいで
しょうか。

2.切り離された理由が、DBの不整合なのか、DBからの応答がなかったのか、判別
する方法はありますでしょうか。

以上、お手数ですがご回答をお願い致します。
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: http://www.sraoss.jp/pipermail/pgpool-general-jp/attachments/20110407/115e72f4/attachment.html 


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