[Pgcluster-general] Question about setup of master/slave pgreplicate

johng at auctionsolutions.com johng at auctionsolutions.com
Wed Jan 24 19:27:36 UTC 2007





I have a question about how to configure to 2 DB's and 2 replication
servers.

I would like to setup the replication servers in a master/slave
configuration.

Although the below configuration works, is it functionally correct?

Is this peer to peer replication?

Is there any other options that need to be configured?

I have two physical machines each with DB and pgreplicate running.

My goal will allow for failure of pgreplicate on dev1 or dev2 and still be
able to keep both DB servers up and in sync.

Thanks for you help.


/etc/hosts is the same on both servers.

/etc/hosts

10.1.1.100  ha-dev1
10.1.1.101  ha-dev2

cluster.conf is the same for both dev1 and dev2

#============================================================
#          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> ha-dev1 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
        <LifeCheck_Port> 8201 </LifeCheck_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> ha-dev2 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
        <LifeCheck_Port> 8201 </LifeCheck_Port>
</Replicate_Server_Info>

<Recovery_Port> 7001 </Recovery_Port>
<Rsync_Path> /usr/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -x </Rsync_Option>
<When_Stand_Alone> read_only  </When_Stand_Alone>
<Status_Log_File> /tmp/cluster.sts </Status_Log_File>
<Error_Log_File> /tmp/cluster.err </Error_Log_File>



pgreplicate.conf is the same for both dev1 and dev2

#=============================================================
#  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>           ha-dev1  </Host_Name>
       <Port>                5432                </Port>
       <Recovery_Port>       7001                </Recovery_Port>
       <LifeCheck_Port>      7201        </LifeCheck_Port>
       <Status_Log_File> /tmp/ha-dev1/pgreplicate.sts </Status_Log_File>
       <Error_Log_File> /tmp/ha-dev1/pgreplicate.log </Error_Log_File>
</Cluster_Server_Info>
<Cluster_Server_Info>
       <Host_Name>           ha-dev2  </Host_Name>
       <Port>                5432                </Port>
       <Recovery_Port>       7001                </Recovery_Port>
       <LifeCheck_Port>      7201        </LifeCheck_Port>
       <Status_Log_File> /tmp/ha-dev2/pgreplicate.sts </Status_Log_File>
       <Error_Log_File> /tmp/ha-dev2/pgreplicate.log </Error_Log_File>
</Cluster_Server_Info>
#-------------------------------------------------------------
# A setup of a replication server
#
#               o Replicate_Port : connection for replication
#               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.
#               o Use_Replication_Log : use replication log
#                                       [yes/no]. default : no
#               o RLOG_Port : connection for replication log
#-------------------------------------------------------------
<Replication_Port>    8001            </Replication_Port>
<Recovery_Port>       8101            </Recovery_Port>
<LifeCheck_Port>     8201               </LifeCheck_Port>
<Response_Mode>       normal          </Response_Mode>
<Use_Replication_Log> yes              </Use_Replication_Log>
<RLOG_Port>           8301            </RLOG_Port>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/pgcluster-general/attachments/20070124/10b87ebd/attachment.html 


More information about the Pgcluster-general mailing list