[pgcluster: 460] レプリケーションができません
inagaki
btmntn @ yahoo.co.jp
2004年 8月 8日 (日) 13:05:27 JST
--0-1215937966-1091937927=:34464
Content-Type: text/plain; charset=iso-2022-jp
稲垣です。
初歩的な質問で申し訳ありませんが、教えて下さい。
レプリケーションサーバ1台、クラスタサーバ2台構成で、レプリケーションを行おうとしています。
使用されて頂いているPGClusterのバージョンは、1.0.7です。
以下の設定をして、「レプリケーションサーバ→クラスタサーバ1→クラスタサーバ2」の順で起動しました。
クラスタサーバ1上で、INSERT文を実行しても、クラスタサーバ2にレプリケーションされません。
原因がわからず困っております。
対処方法をご存知でしたら、教えて頂きたくよろしくお願いします。
レプリケーションサーバでは、「pgreplicate.conf」を以下のように設定しています。
<Cluster_Server_Info>
<Host_Name> db1.postgres.jp </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7779 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> db2.postgres.jp </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7779 </Recovery_Port>
</Cluster_Server_Info>
<Replication_Port> 8777 </Replication_Port>
<Recovery_Port> 7778 </Recovery_Port>
クラスタサーバ1の「cluster.conf」は、以下の設定をしています
<Replicate_Server_Info>
<Host_Name> replicate.postgres.jp </Host_Name>
<Port> 8777 </Port>
<Recovery_Port> 7778 </Recovery_Port>
</Replicate_Server_Info>
<Recovery_Port> 7779 </Recovery_Port>
<Rsync_Path> /usr/local/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<When_Stand_Alone> read_only </When_Stand_Alone>
クラスタサーバ2の「cluster.conf」は、以下の設定をしています
<Replicate_Server_Info>
<Host_Name> replicate.postgres.jp </Host_Name>
<Port> 8777 </Port>
<Recovery_Port> 7778 </Recovery_Port>
</Replicate_Server_Info>
<Recovery_Port> 7779 </Recovery_Port>
<Rsync_Path> /usr/local/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<When_Stand_Alone> read_only </When_Stand_Alone>
レプリケーションサーバを起動すると、「pgreplicate.sts」は、以下のログを出力します。
tail -f pgreplicate.sts
Sun Aug 8 12:43:00 2004 port(5432) host:db1.postgres.jp start use
Sun Aug 8 12:43:00 2004 port(5432) host:db2.postgres.jp start use
Sun Aug 8 12:43:00 2004 cascade(レプリケーションサーバのホスト名) port(8777) start use
Sun Aug 8 12:43:00 2004 cascade(レプリケーションサーバのホスト名) port(8777) become top
レプリケーションサーバを起動すると、以下のログが出力されます
$ pgreplicate -D /usr/local/pgsql/etc -vn
DEBUG(init_server_tbl): /usr/local/pgsql/etc/pgreplicate.sts open ok
DEBUG(init_server_tbl): PGR_Get_Conf_Data ok
DEBUG(init_server_tbl): LoadBalanceTbl allocate ok
DEBUG(init_server_tbl): CascadeTbl shmget ok
DEBUG(init_server_tbl): CascadeTbl shmat ok
DEBUG(init_server_tbl): CascadeInf shmget ok
DEBUG(init_server_tbl): CascadeInf shmat ok
DEBUG(init_server_tbl): CommitLog shmget ok
DEBUG(init_server_tbl): Commit_Log_Tbl shmat ok
DEBUG(init_server_tbl): Conf data read ok
DEBUG(init_server_tbl): HostTbl shmget ok
DEBUG(init_server_tbl): HostTbl shmat ok
DEBUG(write_log_file): LockWaitTbl shmget ok
DEBUG(write_log_file): LockWaitTbl shmat ok
DEBUG(replicate_main): replicate main 8777 port bind OK
DEBUG(PGRrecovery_main): PGRrecovery_main bind port 7778
DEBUG(PGRreplicate_packet_send): cmdSts=N
DEBUG(PGRreplicate_packet_send): cmdType=
DEBUG(PGRreplicate_packet_send): port=0
DEBUG(PGRreplicate_packet_send): pid=0
DEBUG(PGRreplicate_packet_send): except_host=
DEBUG(PGRreplicate_packet_send): from_host=レプリケーションサーバのホスト名
DEBUG(PGRreplicate_packet_send): dbName=template1
DEBUG(PGRreplicate_packet_send): userName=postgres
DEBUG(PGRreplicate_packet_send): recieve sec=0
DEBUG(PGRreplicate_packet_send): recieve usec=0
DEBUG(PGRreplicate_packet_send): query_size=60
DEBUG(PGRreplicate_packet_send): query=SELECT PGR_SYSTEM_COMMAND_FUNCTION(1,'レプリケーションサーバのホスト名',8777,7778)
DEBUG(PGRreplicate_packet_send): useFlag[2]
DEBUG(PGRis_same_host): not same host:
DEBUG(is_need_response): sem_lock[1]
DEBUG(PGRreplicate_packet_send_each_server): except:0@ host:5432 @ db1.postgres.jp
DEBUG(PGRreplicate_packet_send_each_server): send replicate to:db1.postgres.jp
DEBUG(PGRsend_replicate_packet_to_server): host(db1.postgres.jp) : port(5432)
DEBUG(getTransactionTbl): not found in getTransactionTbl
DEBUG(pgr_createConn): PQsetdbLogin host[db1.postgres.jp] port[5432] db[template1] user[postgres]
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): dbPersistLogin timeout
ERROR(pgr_createConn): New Transaction but pgr_createConn failed
ERROR(pgr_createConn): -1073745208 @ db1.postgres.jp is not ready
ERROR(pgr_createConn): setTransactionTbl failed
DEBUG(pgr_createConn): sem_lock[2]
DEBUG(PGRsem_lock): sem_unlock[1]
DEBUG(PGRis_same_host): not same host:
DEBUG(PGRreplicate_packet_send_each_server): except:0@ host:5432 @ db2.postgres.jp
DEBUG(PGRreplicate_packet_send_each_server): send replicate to:db2.postgres.jp
DEBUG(PGRsend_replicate_packet_to_server): host(db2.postgres.jp) : port(5432)
DEBUG(getTransactionTbl): not found in getTransactionTbl
DEBUG(pgr_createConn): PQsetdbLogin host[db2.postgres.jp] port[5432] db[template1] user[postgres]
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!
ERROR(pgr_createConn): dbPersistLogin timeout
ERROR(pgr_createConn): New Transaction but pgr_createConn failed
ERROR(pgr_createConn): -1073745208 @ db2.postgres.jp is not ready
ERROR(pgr_createConn): setTransactionTbl failed
DEBUG(pgr_createConn): sem_lock[3]
DEBUG(PGRsem_lock): sem_unlock[2]
DEBUG(getTransactionTbl): sem_unlock[3]
DEBUG(PGRsem_unlock): PGRreplicate_packet_send end
INSERT文を実行すると、以下のログがでます。
DEBUG(replicate_loop): replicate_loop selected
DEBUG(PGRread_packet): query size=37
DEBUG(PGRread_packet): read[37] query[insert into test1 values(2,'2222222')]
DEBUG(PGRread_packet): query :: insert into test1 values(2,'2222222')
DEBUG(PGRreplicate_packet_send): cmdSts=Q
DEBUG(PGRreplicate_packet_send): cmdType=I
DEBUG(PGRreplicate_packet_send): port=5432
DEBUG(PGRreplicate_packet_send): pid=12550
DEBUG(PGRreplicate_packet_send): except_host=クラスタサーバ1のホスト名
DEBUG(PGRreplicate_packet_send): from_host=クラスタサーバ1のホスト名
DEBUG(PGRreplicate_packet_send): dbName=template1
DEBUG(PGRreplicate_packet_send): userName=postgres
DEBUG(PGRreplicate_packet_send): recieve sec=1091936704
DEBUG(PGRreplicate_packet_send): recieve usec=627074
DEBUG(PGRreplicate_packet_send): query_size=37
DEBUG(PGRreplicate_packet_send): query=insert into test1 values(2,'2222222')
DEBUG(PGRreplicate_packet_send): useFlag[2]
DEBUG(child_wait): replicate main: selected
ご教授頂きたくよろしくお願いします。
---------------------------------
GANBARE! NIPPON!
Yahoo! JAPAN JOC OFFICIAL INTERNET PORTAL SITE
http://mail.ganbare-nippon.yahoo.co.jp/
--0-1215937966-1091937927=:34464
Content-Type: text/html; charset=iso-2022-jp
<table width=100%><tr><td>
<P>稲垣です。</P>
<P>初歩的な質問で申し訳ありませんが、教えて下さい。</P>
<P>レプリケーションサーバ1台、クラスタサーバ2台構成で、レプリケーションを行おうとしています。<BR>使用されて頂いているPGClusterのバージョンは、1.0.7です。</P>
<P>以下の設定をして、「レプリケーションサーバ→クラスタサーバ1→クラスタサーバ2」の順で起動しました。</P>
<P>クラスタサーバ1上で、INSERT文を実行しても、クラスタサーバ2にレプリケーションされません。<BR>原因がわからず困っております。<BR>対処方法をご存知でしたら、教えて頂きたくよろしくお願いします。</P>
<P><BR>レプリケーションサーバでは、「pgreplicate.conf」を以下のように設定しています。<BR><Cluster_Server_Info><BR> <Host_Name> db1.postgres.jp </Host_Name><BR> <Port> 5432 </Port><BR> <Recovery_Port> 7779 </Recovery_Port><BR></Cluster_Server_Info><BR><Cluster_Server_Info><BR> <Host_Name> db2.postgres.jp </Host_Name><BR> <Port> 5432 </Port><BR> <Recovery_Port> 7779 </Recovery_Port><BR></Cluster_Server_Info></P>
<P><Replication_Port> 8777 </Replication_Port><BR><Recovery_Port> 7778 </Recovery_Port></P>
<P><BR>クラスタサーバ1の「cluster.conf」は、以下の設定をしています<BR><Replicate_Server_Info><BR> <Host_Name> replicate.postgres.jp </Host_Name><BR> <Port> 8777 </Port><BR> <Recovery_Port> 7778 </Recovery_Port><BR></Replicate_Server_Info></P>
<P><Recovery_Port> 7779 </Recovery_Port><BR><Rsync_Path> /usr/local/bin/rsync </Rsync_Path><BR><Rsync_Option> ssh -1 </Rsync_Option><BR><When_Stand_Alone> read_only </When_Stand_Alone></P>
<P><BR>クラスタサーバ2の「cluster.conf」は、以下の設定をしています<BR><Replicate_Server_Info><BR> <Host_Name> replicate.postgres.jp </Host_Name><BR> <Port> 8777 </Port><BR> <Recovery_Port> 7778 </Recovery_Port><BR></Replicate_Server_Info></P>
<P><Recovery_Port> 7779 </Recovery_Port><BR><Rsync_Path> /usr/local/bin/rsync </Rsync_Path><BR><Rsync_Option> ssh -1 </Rsync_Option><BR><When_Stand_Alone> read_only </When_Stand_Alone></P>
<P> </P>
<P>レプリケーションサーバを起動すると、「pgreplicate.sts」は、以下のログを出力します。</P>
<P>tail -f pgreplicate.sts<BR>Sun Aug 8 12:43:00 2004 port(5432) host:db1.postgres.jp start use<BR>Sun Aug 8 12:43:00 2004 port(5432) host:db2.postgres.jp start use<BR>Sun Aug 8 12:43:00 2004 cascade(レプリケーションサーバのホスト名) port(8777) start use<BR>Sun Aug 8 12:43:00 2004 cascade(レプリケーションサーバのホスト名) port(8777) become top</P>
<P> </P>
<P>レプリケーションサーバを起動すると、以下のログが出力されます</P>
<P>$ pgreplicate -D /usr/local/pgsql/etc -vn<BR>DEBUG(init_server_tbl): /usr/local/pgsql/etc/pgreplicate.sts open ok</P>
<P>DEBUG(init_server_tbl): PGR_Get_Conf_Data ok<BR>DEBUG(init_server_tbl): LoadBalanceTbl allocate ok<BR>DEBUG(init_server_tbl): CascadeTbl shmget ok<BR>DEBUG(init_server_tbl): CascadeTbl shmat ok<BR>DEBUG(init_server_tbl): CascadeInf shmget ok<BR>DEBUG(init_server_tbl): CascadeInf shmat ok<BR>DEBUG(init_server_tbl): CommitLog shmget ok<BR>DEBUG(init_server_tbl): Commit_Log_Tbl shmat ok<BR>DEBUG(init_server_tbl): Conf data read ok<BR>DEBUG(init_server_tbl): HostTbl shmget ok<BR>DEBUG(init_server_tbl): HostTbl shmat ok<BR>DEBUG(write_log_file): LockWaitTbl shmget ok<BR>DEBUG(write_log_file): LockWaitTbl shmat ok<BR>DEBUG(replicate_main): replicate main 8777 port bind OK<BR>DEBUG(PGRrecovery_main): PGRrecovery_main bind port 7778</P>
<P>DEBUG(PGRreplicate_packet_send): cmdSts=N</P>
<P>DEBUG(PGRreplicate_packet_send): cmdType=</P>
<P>DEBUG(PGRreplicate_packet_send): port=0</P>
<P>DEBUG(PGRreplicate_packet_send): pid=0</P>
<P>DEBUG(PGRreplicate_packet_send): except_host=</P>
<P>DEBUG(PGRreplicate_packet_send): from_host=レプリケーションサーバのホスト名</P>
<P>DEBUG(PGRreplicate_packet_send): dbName=template1</P>
<P>DEBUG(PGRreplicate_packet_send): userName=postgres</P>
<P>DEBUG(PGRreplicate_packet_send): recieve sec=0</P>
<P>DEBUG(PGRreplicate_packet_send): recieve usec=0</P>
<P>DEBUG(PGRreplicate_packet_send): query_size=60</P>
<P>DEBUG(PGRreplicate_packet_send): query=SELECT PGR_SYSTEM_COMMAND_FUNCTION(1,'レプリケーションサーバのホスト名',8777,7778)</P>
<P>DEBUG(PGRreplicate_packet_send): useFlag[2]<BR>DEBUG(PGRis_same_host): not same host:<BR>DEBUG(is_need_response): sem_lock[1]<BR>DEBUG(PGRreplicate_packet_send_each_server): except:0@ host:5432 @ db1.postgres.jp</P>
<P>DEBUG(PGRreplicate_packet_send_each_server): send replicate to:db1.postgres.jp</P>
<P>DEBUG(PGRsend_replicate_packet_to_server): host(db1.postgres.jp) : port(5432)<BR>DEBUG(getTransactionTbl): not found in getTransactionTbl<BR>DEBUG(pgr_createConn): PQsetdbLogin host[db1.postgres.jp] port[5432] db[template1] user[postgres]<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): dbPersistLogin timeout<BR>ERROR(pgr_createConn): New Transaction but pgr_createConn failed<BR>ERROR(pgr_createConn): <A href="mailto:-1073745208 @ db1.postgres.jp">-1073745208 @ db1.postgres.jp</A> is not ready<BR>ERROR(pgr_createConn): setTransactionTbl failed<BR>DEBUG(pgr_createConn): sem_lock[2]<BR>DEBUG(PGRsem_lock): sem_unlock[1]<BR>DEBUG(PGRis_same_host): not same host:<BR>DEBUG(PGRreplicate_packet_send_each_server): except:0@ host:5432 @ db2.postgres.jp</P>
<P>DEBUG(PGRreplicate_packet_send_each_server): send replicate to:db2.postgres.jp</P>
<P>DEBUG(PGRsend_replicate_packet_to_server): host(db2.postgres.jp) : port(5432)<BR>DEBUG(getTransactionTbl): not found in getTransactionTbl<BR>DEBUG(pgr_createConn): PQsetdbLogin host[db2.postgres.jp] port[5432] db[template1] user[postgres]<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): PQsetdbLogin failed. close socket!!<BR>ERROR(pgr_createConn): dbPersistLogin timeout<BR>ERROR(pgr_createConn): New Transaction but pgr_createConn failed<BR>ERROR(pgr_createConn): <A href="mailto:-1073745208 @ db2.postgres.jp">-1073745208 @ db2.postgres.jp</A> is not ready<BR>ERROR(pgr_createConn): setTransactionTbl failed<BR>DEBUG(pgr_createConn): sem_lock[3]<BR>DEBUG(PGRsem_lock): sem_unlock[2]<BR>DEBUG(getTransactionTbl): sem_unlock[3]<BR>DEBUG(PGRsem_unlock): PGRreplicate_packet_send end</P>
<P> </P>
<P><BR>INSERT文を実行すると、以下のログがでます。</P>
<P>DEBUG(replicate_loop): replicate_loop selected</P>
<P>DEBUG(PGRread_packet): query size=37<BR>DEBUG(PGRread_packet): read[37] query[insert into test1 values(2,'2222222')]<BR>DEBUG(PGRread_packet): query :: insert into test1 values(2,'2222222')</P>
<P>DEBUG(PGRreplicate_packet_send): cmdSts=Q</P>
<P>DEBUG(PGRreplicate_packet_send): cmdType=I</P>
<P>DEBUG(PGRreplicate_packet_send): port=5432</P>
<P>DEBUG(PGRreplicate_packet_send): pid=12550</P>
<P>DEBUG(PGRreplicate_packet_send): except_host=クラスタサーバ1のホスト名</P>
<P>DEBUG(PGRreplicate_packet_send): from_host=クラスタサーバ1のホスト名</P>
<P>DEBUG(PGRreplicate_packet_send): dbName=template1</P>
<P>DEBUG(PGRreplicate_packet_send): userName=postgres</P>
<P>DEBUG(PGRreplicate_packet_send): recieve sec=1091936704</P>
<P>DEBUG(PGRreplicate_packet_send): recieve usec=627074</P>
<P>DEBUG(PGRreplicate_packet_send): query_size=37</P>
<P>DEBUG(PGRreplicate_packet_send): query=insert into test1 values(2,'2222222')</P>
<P>DEBUG(PGRreplicate_packet_send): useFlag[2]<BR>DEBUG(child_wait): replicate main: selected</P>
<P><BR>ご教授頂きたくよろしくお願いします。</P>
<P> </P>
</td></tr></table>
<p><br><hr size=1>GANBARE! NIPPON!<br>
Yahoo! JAPAN JOC OFFICIAL INTERNET PORTAL SITE<br>
<a href="http://mail.ganbare-nippon.yahoo.co.jp/">http://mail.ganbare-nippon.yahoo.co.jp/</a>
--0-1215937966-1091937927=:34464--
pgcluster メーリングリストの案内