[pgcluster: 760] Re: 部分レプリケーションの設定について

Shiro aoki @ flexpoint.co.jp
2005年 3月 16日 (水) 18:32:16 JST


お世話になります。
青木です。

設定ファイルは下記の通りです。

−−−−サーバーAの設定−−−−−−−−−−−−−−−−−−−−−−−
【postgresql.conf】
#---------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#---------------------------------------------------------------------------
# - Connection Settings -
##listen_addresses = 'localhost' # what IP interface(s) to listen on;
listen_addresses = '*' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any
##port = 5432
port = 5432
max_connections = 100

【pg_hba.conf】
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.232.0/24 trust
# IPv6 local connections:
#host all all ::1/128 trust

【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> replication_1 </Host_Name>
<Port> 8001 </Port>
<Recovery_Port> 8101 </Recovery_Port>
<LifeCheck_Port> 8201 </LifeCheck_Port>
</Replicate_Server_Info>
#<Replicate_Server_Info>
# <Host_Name> replicate2.postgres.jp </Host_Name>
# <Port> 8002 </Port>
# <Recovery_Port> 8102 </Recovery_Port>
# <LifeCheck_Port> 8202 </LifeCheck_Port>
#</Replicate_Server_Info>
#<Replicate_Server_Info>
# <Host_Name> replicate3.postgres.jp </Host_Name>
# <Port> 8003 </Port>
# <Recovery_Port> 8103 </Recovery_Port>
# <LifeCheck_Port> 8203 </LifeCheck_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> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
<Rsync_Path> /usr/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<When_Stand_Alone> read_write </When_Stand_Alone>
<Status_Log_File> /tmp/1/cluster.sts </Status_Log_File>
<Error_Log_File> /tmp/1/cluster.log </Error_Log_File>
#-------------------------------------------------------------
# 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>
<Not_Replicate_Info>
<DB_Name> TESTDB </DB_Name>
<Table_Name> table_c </Table_Name>
</Not_Replicate_Info>


−−−−サーバーBの設定−−−−−−−−−−−−−−−−−−−−−−−
【postgresql.conf】
#---------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#---------------------------------------------------------------------------
# - Connection Settings -
##listen_addresses = 'localhost' # what IP interface(s) to listen on;
listen_addresses = '*' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any
##port = 5432
port = 5432
max_connections = 100

【pg_hba.conf】
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.232.0/24 trust
# IPv6 local connections:
#host all all ::1/128 trust

【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> replication_1 </Host_Name>
<Port> 8001 </Port>
<Recovery_Port> 8101 </Recovery_Port>
<LifeCheck_Port> 8201 </LifeCheck_Port>
</Replicate_Server_Info>
#<Replicate_Server_Info>
# <Host_Name> replicate2.postgres.jp </Host_Name>
# <Port> 8002 </Port>
# <Recovery_Port> 8102 </Recovery_Port>
# <LifeCheck_Port> 8202 </LifeCheck_Port>
#</Replicate_Server_Info>
#<Replicate_Server_Info>
# <Host_Name> replicate3.postgres.jp </Host_Name>
# <Port> 8003 </Port>
# <Recovery_Port> 8103 </Recovery_Port>
# <LifeCheck_Port> 8203 </LifeCheck_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> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
<Rsync_Path> /usr/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<When_Stand_Alone> read_write </When_Stand_Alone>
<Status_Log_File> /tmp/1/cluster.sts </Status_Log_File>
<Error_Log_File> /tmp/1/cluster.log </Error_Log_File>
#-------------------------------------------------------------
# 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>
<Not_Replicate_Info>
<DB_Name> TESTDB </DB_Name>
<Table_Name> table_c </Table_Name>
</Not_Replicate_Info>

【pgreplicate.conf】
#=============================================================
# PGReplicate configuration file
# for PGCluster-1.1.0a
#-------------------------------------------------------------
# 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 .
# o LifeCheck_Port : connection for life check process
#-------------------------------------------------------------
<Cluster_Server_Info>
<Host_Name> master </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> master_2 </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
</Cluster_Server_Info>
#<Cluster_Server_Info>
# <Host_Name> cluster3.postgres.jp </Host_Name>
# <Port> 5432 </Port>
# <Recovery_Port> 7101 </Recovery_Port>
# <LifeCheck_Port> 7201 </LifeCheck_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 .
# o LifeCheck_Port : connection for life check process
#-------------------------------------------------------------
#<LoadBalance_Server_Info>
# <Host_Name> master </Host_Name>
# <Recovery_Port> 6101 </Recovery_Port>
# <LifeCheck_Port> 6201 </LifeCheck_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 .
# o LifeCheck_Port : connection for life check process
#------------------------------------------------------------
#<Replicate_Server_Info>
# <Host_Name> upper_replicate.postgres.jp </Host_Name>
# <Port> 8001 </Port>
# <Recovery_Port> 8101 </Recovery_Port>
# <LifeCheck_Port> 8201 </LifeCheck_Port>
#</Replicate_Server_Info>
#
#-------------------------------------------------------------
# A setup of a replication server
#
# o Status_Log_File : logging file of cluster db's status
# o Error_Log_File : logging file of error and warning
# o Replicate_Port : connection for reprication
# o Recovery_Port : connection for recovery
# o LifeCheck_Port : connection for life check process
# 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.
# o Use_Replication_Log : When this server hangs up without
# being replicated to the end,
# a remote server continues the
# replication using this log.
# yes -- use replication log
# no -- not use replication log
# o Reserved_Connections : The number of reserved connections
# from this replication server
# to each cluster dbs.
# (default is 1).
#-------------------------------------------------------------
<Status_Log_File> /tmp/1/pgreplicate.sts </Status_Log_File>
<Error_Log_File> /tmp/1/pgreplicate.log </Error_Log_File>
<Replication_Port> 8001 </Replication_Port>
<Recovery_Port> 8101 </Recovery_Port>
<LifeCheck_Port> 8201 </LifeCheck_Port>
<RLOG_Port> 8301 </RLOG_Port>
<Response_Mode> normal </Response_Mode>
<Use_Replication_Log> yes </Use_Replication_Log>
<Reserved_Connections> 1 </Reserved_Connections>

以上です。
よろしくお願いします。

mitani wrote:

>三谷@広島です.
>  
>
>>そのクラスタdbにそれぞれ、レプリケーションをしないテーブルを定義するで
>>よろしいでしょうか?
>>    
>>
>念のため,それぞれのクラスタDBの設定ファイルを見せてもらえませんか?
>
>=============================
>STATUS:V3プロトコル対応中
>三谷 篤<mitani @ sraw.co.jp>
>=============================
>
>
>
>
>  
>





pgcluster メーリングリストの案内