[pgpool-general-jp: 48] Re: pgpoolの縮退運転について

ktj @ mrj.biglobe.ne.jp ktj @ mrj.biglobe.ne.jp
2006年 12月 7日 (木) 05:58:08 JST


山崎です。

xeon-koyamaさん、レスありがとうございます。

> master_slave_mode = false

私の理解も正しいかどうかわかりませんが、
replication_mode = true 時には master_slave_mode 設定は
無視されると理解しています。
現状のpgpool.confの設定でreplicationの動作に関わってくる
パラメータは以下だけで、

 replication_mode = true
 replication_strict = true
 replication_stop_on_mistmatch = true
 load_balance_mode = false

この時の動作は、

・負荷分散はせず、かならずmaster/secondary両方に問い合わせを投げる
・STRICTモードなので deadlock_timeout は無効
・pgpoolはまずmasterへ問い合わせを投げる
・masterへの問い合わせが完了するまでsecondaryに問い合わせは送信しない
・masterへの問い合わせが完了後、secondaryに問い合わせを投げる
・master/secondaryの実行結果が不一致の場合、縮退運転に入る
・secondaryへの問い合わせが完了後、クライアントに結果を返す

となると考えているのですが、間違っておりますでしょうか?

> > ---- /etc/pgpool.conf
> > max_pool = 1

Postgresのプロセスの起動数でセッション数がどのくらいあるか
統計情報を取得している関係上、max_poolはあえて1にして
num_init_childrenを多めにしてます。
JDBC→pgpool間もConnectionPoolがあるので、純粋にはActiveな
セッションのモニタが出来ないのはわかっていますが、
ある程度は参考になるかと考えています。

障害発生時にセッション数が必ず多い、ということはなく
多くても32〜60程度なのであまり関係ないかと思っているのですが...

> 浅羽さんpatchの JDBC対応 pgpoolをお使いでしょうか?

こちらは8.x以降の拡張問い合わせ対応のものと思っていたので、
7.4の環境では無関係かと思っていました。
(この制約がありそうだったので最初から8.x系は避けているのですが)

再現できるかどうか分かりませんが、パッチ適用版でも試してみたいと思います。

> あと、pgpoolの show pool_status の情報もあると良いかもしれません。

障害時の show pool_status になります。

よろしくおねがいします。


             item             |                        value                           |                              description
------------------------------+--------------------------------------------------------+------------------------------------------------------------------------
 listen_addresses             | localhost                                              | host name(s) or IP address(es) to listen to
 port                         | 5432                                                   | pgpool accepting port number
 socket_dir                   | /tmp                                                   | pgpool socket directory
 backend_host_name            | node1                                                  | master backend host name
 backend_port                 | 5431                                                   | master backend port number
 secondary_backend_host_name  | node2                                                  | secondary backend host name
 secondary_backend_port       | 5433                                                   | secondary backend port number
 num_init_children            | 128                                                    | # of children initially pre-forked
 child_life_time              | 300                                                    | if idle for this seconds, child exits
 connection_life_time         | 0                                                      | if idle for this seconds, connection closes
 child_max_connections        | 0                                                      | if max_connections received, chile exits
 max_pool                     | 1                                                      | max # of connection pool per child
 logdir                       | /tmp                                                   | logging directory
 backend_socket_dir           | /tmp                                                   | Unix domain socket directory for the PostgreSQL server
 replication_mode             | 1                                                      | non 0 if operating in replication mode
 replication_strict           | 1                                                      | non 0 if operating in strict mode
 replication_timeout          | 5000                                                   | if secondary does not respond in this milli seconds, abort the session
 load_balance_mode            | 0                                                      | non 0 if operating in load balancing mode
 weight_master                | 0.500000                                               | weight of master
 weight_secondary             | 0.500000                                               | weight of secondary
 replication_stop_on_mismatch | 1                                                      | stop replication mode on fatal error
 reset_query_list             | ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT;   | queries issued at the end of session
 print_timestamp              | 1                                                      | if true print time stamp to each log line
 master_slave_mode            | 0                                                      | if true, operate in master/slave mode
 connection_cache             | 1                                                      | if true, cache connection pool
 health_check_timeout         | 20                                                     | health check timeout
 health_check_period          | 300                                                    | health check period
 health_check_user            | postgres                                               | health check user
 insert_lock                  | 0                                                      | insert lock
 ignore_leading_white_space   | 0                                                      | ignore leading white spaces
 current_backend_host_name    | node2                                                  | current master host name
 current_backend_port         | 5433                                                   | current master port #
 replication_enabled          | 0                                                      | non 0 if actually operating in replication mode
 master_slave_enabled         | 0                                                      | non 0 if actually operating in master/slave
 num_reset_queries            | 3                                                      | number of queries in reset_query_list
 server_status                | master(node1 on 5431) down secondary(node2 on 5433) up | server status
(36 rows)




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