[pgcluster: 610] Re: シーケンス番号の整合性が崩れる
kazunari takahashi
kazunari.takahashi @ ctc-g.co.jp
2004年 12月 8日 (水) 09:34:21 JST
三谷様
おはようございます.
高橋です.
> > 2つのレプリケーションサーバが立ち上がっていますので、
> > 常にセカンダリのレプリケーションサーバに接続されているセッションと,
> > プライマリのレプリケーションサーバに接続されているセッションがある状態です.
> それはまずいです。
上記について確認させてください.
セカンダリのレプリケーションサーバでpgreplicateプロセスを立ち上げると、
下のような状態になります.
% netstat -na | grep -i establish
192.168.1.122.8001 192.168.1.113.60802 24820 0 24820 0 ESTABLISHED
192.168.1.122.8001 192.168.1.111.35624 24820 0 24820 0 ESTABLISHED
※192.168.1.122 --セカンダリレプリケーションサーバ
192.168.1.111 --clusterDB
192.168.1.113 --clusterDB
私が使用した「セッション」と言う言葉は、上記のESTABLISHされた接続のことを指していました.
clusterDB毎に異なったレプリケーションサーバを使用しているわけではございません.
全clusterDBに設定されている、プライマリ・セカンダリのレプリケーションサーバは同一です.
また、セカンダリのレプリケーションサーバのpgreplicateプロセスは起動しつづけています.
(マスタ・レプリケーションサーバ障害時にスレーブに自動的に切り替わる為に)
このような状態でもまずいですか?
################
#cluster.conf
################
% cat data/cluster.conf
#============================================================
# Cluster DB Server configuration file
#------------------------------------------------------------
# file: cluster.conf
#------------------------------------------------------------
# This file controls:
# o which hosts & port are replication server
# o which port use for replication request to replication server
# o which command use for recovery function
#============================================================
#------------------------------------------------------------
# set Replication Server information
# o Host_Name : hostname
# o Port : connection for postmaster
# o Recovery_Port : connection for recovery process
#------------------------------------------------------------
<Replicate_Server_Info>
<Host_Name> pgrp01 </Host_Name>
<Port> 8001 </Port>
<Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
<Host_Name> pgrp02 </Host_Name>
<Port> 8001 </Port>
<Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
#<Replicate_Server_Info>
# <Host_Name> replicate3.postgres.jp </Host_Name>
# <Port> 8003 </Port>
# <Recovery_Port> 8103 </Recovery_Port>
#</Replicate_Server_Info>
#-------------------------------------------------------------
# set Cluster DB Server information
# o Recovery_Port : connection for recovery
# o Rsync_Path : path of rsync command
# o Rsync_Option : file transfer option for rsync
# o When_Stand_Alone : When all replication servers fell,
# you can set up two kinds of permittion,
# "real_only" or "read_write".
#-------------------------------------------------------------
<Recovery_Port> 8102 </Recovery_Port>
<Rsync_Path> /usr/local/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<When_Stand_Alone> read_only </When_Stand_Alone>
#-------------------------------------------------------------
# set partitional replicate control information
# set DB name and Table name to stop reprication
# o DB_Name : DB name
# o Table_Name : table name
#-------------------------------------------------------------
#<Not_Replicate_Info>
# <DB_Name> test_db </DB_Name>
# <Table_Name> log_table </Table_Name>
#</Not_Replicate_Info>
################
#pgreplicate.conf
################
% cat pgreplicate.conf
#=============================================================
# PGReplicate configuration file
#-------------------------------------------------------------
# file: pgreplicate.conf
#-------------------------------------------------------------
# This file controls:
# o which hosts & port are cluster server
# o which port use for replication request from cluster server
#=============================================================
#
#-------------------------------------------------------------
# A setup of Cluster DB(s)
#
# o Host_Name : The host name of Cluster DB.
# -- please write a host name by FQDN.
# -- do not write IP address.
# o Port : The connection port with postmaster.
# o Recovery_Port : The connection port at the time of
# a recovery sequence .
#-------------------------------------------------------------
<Cluster_Server_Info>
<Host_Name> serverB </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 8102 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> serverA </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 8102 </Recovery_Port>
</Cluster_Server_Info>
#<Cluster_Server_Info>
# <Host_Name> serverC </Host_Name>
# <Port> 5432 </Port>
# <Recovery_Port> 8102 </Recovery_Port>
#</Cluster_Server_Info>
#
#-------------------------------------------------------------
# A setup of Load Balance Server
#
# o Host_Name : The host name of a load balance server.
# -- please write a host name by FQDN.
# -- do not write IP address.
# o Recovery_Port : The connection port at the time of
# a recovery sequence .
#-------------------------------------------------------------
<LoadBalance_Server_Info>
<Host_Name> pglb01 </Host_Name>
<Recovery_Port> 6001 </Recovery_Port>
</LoadBalance_Server_Info>
<LoadBalance_Server_Info>
<Host_Name> pglb02 </Host_Name>
<Recovery_Port> 6001 </Recovery_Port>
</LoadBalance_Server_Info>
#
#------------------------------------------------------------
# A setup of the upper replication server for cascade connection.
#
# o Host_Name : The host name of Cluster DB.
# -- please write a host name by FQDN.
# -- do not write IP address.
# o Port : The connection port with postmaster.
# o Recovery_Port : The connection port at the time of
# a recovery sequence .
#------------------------------------------------------------
#<Replicate_Server_Info>
# <Host_Name> upper_replicate.postgres.jp </Host_Name>
# <Port> 8002 </Port>
# <Recovery_Port> 8102 </Recovery_Port>
#</Replicate_Server_Info>
#
#-------------------------------------------------------------
# A setup of a replication server
#
# o Replicate_Port : connection for reprication
# o Recovery_Port : connection for recovery
# o Response_mode : timing which returns a response
# normal -- return result of DB which received the query
# reliable -- return result after waiting for response of
# all Cluster DBs.
#-------------------------------------------------------------
<Replication_Port> 8001 </Replication_Port>
<Recovery_Port> 8101 </Recovery_Port>
<Response_Mode> reliable </Response_Mode>
高橋 一成 <kazunari.takahashi @ ctc-g.co.jp>
pgcluster メーリングリストの案内