@
A setup of replication server
|
Sample Replication Server Architecture
|
The Replication Server has a setting parameter within a system as shown
in the following figures.Explanation of the setting parameter in this
page is due to the following figure.
The sample file ("pgreplicate.conf.sample") of a configuration file
is created under the "etc" directory under an installation directory
(default is "/usr/local/pgsql/etc") by a replication server's installation.
Please copy this file, create the file "pgreplicate.conf" and edit
according to each environment. At the time of starting of a replication server,
the path of this configuration file can be specified as a parameter.
$cd /usr/local/pgsql/etc
$cp [path to source]/src/pgcluster/pgrp/pgreplicate.conf.sample pgreplicate.conf
|
A setup of 'pgreplicate.conf' file
|
#=============================================
# pgreplicate.conf
#---------------------------------------------
# There are two kinds of the description methods of the setup value
in this file.
# One is the setting up two or more values, and another is the setting
up one value at a time.
#
# <Table_Name_Tag>
# <Data_Name_Tag1> value1 </Data_Name_Tag1>
# <Data_Name_Tag2> value2 </Data_Name_Tag2>
# <Data_Name_Tag3> value3 </Data_Name_Tag3>
# </Table_Name_Tag>
# or
# <Data_Name_Tag> value </Data_Name_Tag>
#
# It is interpreted as a comment after "#"
#=============================================
#--------------------------------------------------------------------
# The setup value of Cluster DB
#--------------------------------------------------------------------
<Cluster_Server_Info>
<Host_Name> cluster_1
</Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> cluster_1
</Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> cluster_1
</Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7101 </Recovery_Port>
<LifeCheck_Port> 7201 </LifeCheck_Port>
</Cluster_Server_Info>
#--------------------------------------------------------------------
# A setup of loader balancer
#--------------------------------------------------------------------
<LoadBalance_Server_Info>
<Host_Name> loadbalancer
</Host_Name>
<Recovery_Port> 6101 </Recovery_Port>
<LifeCheck_Port> 6201 </LifeCheck_Port>
</LoadBalance_Server_Info>
#------------------------------------------------------------
# A setup for cascade connection is described.
# (which is description needlessness when
there is no higher rank replication server)
#------------- -----------------------------------------------
#<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
#--------------------------------------------------------------------
<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> no </Use_Replication_Log>
<Reserved_Connections> 1 </Reserved_Connections>
|
(1)A setup about Cluster DB
E<Cluster_Server_Info>`</Cluster_Server_Info>
A setup of Cluster DB is declared. The setup value (a host name, the port
number for postmaster, port number for recovery) of Cluster DB is described
between a start tag and an end tag. Two or more Cluster DBs can be set
up. Fundamentally, the first Cluster DB becomes Master DB. When a problem
occurs in the first Cluster DB, the following Cluster DB becomes Master
DB.
E<Host_Name>`</Host_Name>
The host name of Cluster DB describes. Please do
not describe an IP address.
E<Port>`</Port>
The port number of Cluster DB (postmaster) is described.
E<Recovery_Port>`</Recovery_Port>
The port number of the master DB connected at the time of recovery is
described.
E<LifeCheck_Port>`</LifeCheck_Port>
The port number which receives the life check from other servers is described.
(2)A setup about loader balancer
E<LoadBalance_Server_Info>`</LoadBalance_Server_Info>
A setup of loader balancer is declared. The setup value (a host name,
port number for recovery) of loader balancer is described between a start
tag and an end tag. Two or more information on loader balancer can be
set up.
E<Host_Name>`</Host_Name>
The host name of loader balancer describes. Please do
not describe an IP address.
E<Recovery_Port>`</Recovery_Port>
The port number of the loader balancer connected at the time of recovery
of Cluster DB is described.
E<LifeCheck_Port>`</LifeCheck_Port>
The port number which receives the life check from other servers is described.
(3)A setup of a replication server
E<Status_Log_File> ` </Status_Log_File>
The log file name which records the status of the Cluster DBs which this
replication server has connected is described.
E<Error_Log_File> ` </Error_Log_File>
The log file name which records the debugging message and error message
of this replication server is described
E<Replication_Port>`</Replication_Port>
The port number which receives the replication demand from Cluster DB
is described.
E<Recovery_Port>`</Recovery_Port>
The port number which receives the recovery demand from Cluster DB is
described.
E<LifeCheck_Port>`</LifeCheck_Port>
The port number which receives the life check from other servers is described.
E<RLOG_Port> `</RLOG_Port>
The port number which receives a replication log is described.
E<Response_Mode>`</Response_Mode>
The timing which returns a response to the Cluster DB is specified.
'normal' returns a response, when
the cluster DB which received the query executedD
'reliable' returns a response, after
waiting to complete execution in all the cluster DBs.
E<Use_Replication_Log> `</Use_Replication_Log>
It is described whether a replication log is used.
'yes' is described when using it.
'no' is described when not using it.
D
When using a replication log, two or more replication servers which have
connected in the cascade are required.
E<Reserved_Connections> `</Reserved_Connections>
The number of pools of the session connected to Cluster DB from a replication
server is described. A pooling session is created per DB + user. By sharing
this, the number of sessions consumed by Cluster DB for a replication
demand can be stopped.
|