[Pgcluster-general] Last chance to get everything working

John Gardner john.gardner at tagish.co.uk
Wed May 23 10:58:46 UTC 2007


Thanks for the reply Atsushi.

a.mitani at sra-europe.com wrote:
> Hi,
> 
> When replication works well, I think basic configuration has no problem.
> Therefore the cause of recovery failure may be the setup of rsync.
> Would you check it with following page.
> http://pgcluster.projects.postgresql.org/rsync.html

I honestly believe that I have set this up exactly as the above
instructions say, I followed them to the letter!  But, I will go through
them again :-)

> 
> In this case,
> In each pgreplicate.conf need
> 1. same order of cluster db and loadbalancer is required.
> 2. comment out <Replicate_Server_Info> data
> 3. set 'no' to <Use_Replication_Log>

My pgreplicate.conf are listed below:

#-------------------------------------------------------------
# file: pgreplicate.conf (cluster_1)
#-------------------------------------------------------------
# A setup of Cluster DB(s)
#-------------------------------------------------------------
<Cluster_Server_Info>
    <Host_Name> cluster_1 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_3 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
#--------------------------------------------------------------------
# A setup of loader balancer
#--------------------------------------------------------------------
<LoadBalance_Server_Info>
    <Host_Name> cluster_1 </Host_Name>
    <Recovery_Port> 6101 </Recovery_Port>
</LoadBalance_Server_Info>
<LoadBalance_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Recovery_Port> 6101 </Recovery_Port>
</LoadBalance_Server_Info>
#------------------------------------------------------------
# A setup of a replication server
#-------------------------------------------------------------
<Host_Name> cluster_1	</Host_Name>
<Replication_Port> 8001	</Replication_Port>
<Recovery_Port>	8101 </Recovery_Port>
<RLOG_Port> 8301 </RLOG_Port>
<Response_Mode>	normal	</Response_Mode>
<Use_Replication_Log> no </Use_Replication_Log>
<Replication_Timeout> 50s </Replication_Timeout>
<LifeCheck_Timeout> 5s	</LifeCheck_Timeout>
<LifeCheck_Interval> 30s </LifeCheck_Interval>
#-------------------------------------------------------------
# A setup of a log files
#-------------------------------------------------------------
<Log_File_Info>
	<File_Name> /var/log/postgresql/pgreplicate.log </File_Name>
	<File_Size> 1M </File_Size>
	<Rotate> 3 </Rotate>
</Log_File_Info>


#-------------------------------------------------------------
# file: pgreplicate.conf (cluster_2)
#-------------------------------------------------------------
# A setup of Cluster DB(s)
#-------------------------------------------------------------
<Cluster_Server_Info>
    <Host_Name> cluster_1 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_3 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
#-------------------------------------------------------------
# A setup of Load Balance Server
#--------------------------------------------------------------------
<LoadBalance_Server_Info>
   <Host_Name> cluster_1 </Host_Name>
    <Recovery_Port> 6101 </Recovery_Port>
</LoadBalance_Server_Info>
<LoadBalance_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Recovery_Port> 6101 </Recovery_Port>
</LoadBalance_Server_Info>
#------------------------------------------------------------
# Specify Primary replication server
#-------------------------------------------------------------
<Replicate_Server_Info>
        <Host_Name> cluster_1 </Host_Name>
        <Port> 8001 </Port>
        <RLOG_Port> 8301 </RLOG_Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
#-------------------------------------------------------------
# A setup of a replication server
#-------------------------------------------------------------
<Host_Name> cluster_2	</Host_Name>
<Replication_Port> 8001	</Replication_Port>
<Recovery_Port>	8101 </Recovery_Port>
<RLOG_Port> 8301 </RLOG_Port>
<Response_Mode>	normal	</Response_Mode>
<Use_Replication_Log> no </Use_Replication_Log>
<Replication_Timeout> 50s </Replication_Timeout>
<LifeCheck_Timeout> 5s	</LifeCheck_Timeout>
<LifeCheck_Interval> 30s </LifeCheck_Interval>
#-------------------------------------------------------------
# A setup of a log files
#-------------------------------------------------------------
<Log_File_Info>
	<File_Name> /var/log/postgresql/pgreplicate.log </File_Name>
	<File_Size> 1M </File_Size>
	<Rotate> 3 </Rotate>
</Log_File_Info>


#-------------------------------------------------------------
# file: pgreplicate.conf (cluster_3)
#-------------------------------------------------------------
# A setup of Cluster DB(s)
#-------------------------------------------------------------
<Cluster_Server_Info>
    <Host_Name> cluster_1 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_3 </Host_Name>
    <Port> 5432 </Port>
    <Recovery_Port> 7001 </Recovery_Port>
</Cluster_Server_Info>
#-------------------------------------------------------------
# A setup of Load Balance Server
#--------------------------------------------------------------------
<LoadBalance_Server_Info>
   <Host_Name> cluster_1 </Host_Name>
    <Recovery_Port> 6101 </Recovery_Port>
</LoadBalance_Server_Info>
<LoadBalance_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Recovery_Port> 6101 </Recovery_Port>
</LoadBalance_Server_Info>
#------------------------------------------------------------
# Specify Primary replication server
#-------------------------------------------------------------
<Replicate_Server_Info>
        <Host_Name> cluster_1 </Host_Name>
        <Port> 8001 </Port>
        <RLOG_Port> 8301 </RLOG_Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
#-------------------------------------------------------------
# A setup of a replication server
#-------------------------------------------------------------
<Host_Name> cluster_3	</Host_Name>
<Replication_Port> 8001	</Replication_Port>
<Recovery_Port>	8101 </Recovery_Port>
<RLOG_Port> 8301 </RLOG_Port>
<Response_Mode>	normal </Response_Mode>
<Use_Replication_Log> no </Use_Replication_Log>
<Replication_Timeout> 50s </Replication_Timeout>
<LifeCheck_Timeout> 5s </LifeCheck_Timeout>
<LifeCheck_Interval> 30s </LifeCheck_Interval>
#-------------------------------------------------------------
# A setup of a log files
#-------------------------------------------------------------
<Log_File_Info>
	<File_Name> /var/log/postgresql/pgreplicate.log </File_Name>
	<File_Size> 1M </File_Size>
	<Rotate> 3 </Rotate>
</Log_File_Info>

I would appreciate it if you could examine the configuration to see if
it is correct.  Other than commenting out Response_Mode (which I will
try), I cannot see anything wrong with the pgreplicate.conf (unless you
can see something wrong)

> 
> In each pglb.conf need
> 1. same order of cluster db is required

My pglb.conf are:

#-------------------------------------------------------------
# file: pglb.conf (cluster_1)
#-------------------------------------------------------------
# set cluster DB server information
#--------------------------------------------------------------------
<Cluster_Server_Info>
    <Host_Name> cluster_1 </Host_Name>
    <Port> 5432 </Port>
    <Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Port> 5432 </Port>
    <Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_3 </Host_Name>
    <Port> 5432 </Port>
    <Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
#-------------------------------------------------------------
# set Load Balance server information
#-------------------------------------------------------------
<Host_Name>   cluster_1  </Host_Name>
<Backend_Socket_Dir>    /tmp     </Backend_Socket_Dir>
<Receive_Port>          5433     </Receive_Port>
<Recovery_Port>         6101     </Recovery_Port>
<Max_Cluster_Num>        128     </Max_Cluster_Num>
<Use_Connection_Pooling>  no     </Use_Connection_Pooling>
<LifeCheck_Timeout> 3s	</LifeCheck_Timeout>
<LifeCheck_Interval> 15s </LifeCheck_Interval>
#-------------------------------------------------------------
# A setup of a log files
#-------------------------------------------------------------
<Log_File_Info>
	<File_Name> /var/log/postgresql/pglb.log </File_Name>
	<File_Size> 1M </File_Size>
	<Rotate> 3 </Rotate>
</Log_File_Info>

#-------------------------------------------------------------
# file: pglb.conf (cluster_2)
#-------------------------------------------------------------
# set cluster DB server information
#--------------------------------------------------------------------
<Cluster_Server_Info>
    <Host_Name> cluster_1 </Host_Name>
    <Port> 5432 </Port>
    <Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_2 </Host_Name>
    <Port> 5432 </Port>
    <Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
    <Host_Name> cluster_3 </Host_Name>
    <Port> 5432 </Port>
    <Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
#-------------------------------------------------------------
# set Load Balance server information
#-------------------------------------------------------------
<Host_Name>   cluster_2  </Host_Name>
<Backend_Socket_Dir>    /tmp     </Backend_Socket_Dir>
<Receive_Port>          5433     </Receive_Port>
<Recovery_Port>         6101     </Recovery_Port>
<Max_Cluster_Num>        128     </Max_Cluster_Num>
<Use_Connection_Pooling>  no     </Use_Connection_Pooling>
<LifeCheck_Timeout> 3s 	</LifeCheck_Timeout>
<LifeCheck_Interval> 15s </LifeCheck_Interval>
#-------------------------------------------------------------
# A setup of a log files
#-------------------------------------------------------------
<Log_File_Info>
	<File_Name> /var/log/postgresql/pglb.log </File_Name>
	<File_Size> 1M </File_Size>
	<Rotate> 3 </Rotate>
</Log_File_Info>

Again, I cannot see anything wrong.

> 
> In each cluster.conf need
> 1. same order of replication server
> 2. set correct path of rsync and pg_dump

#------------------------------------------------------------
# file: cluster.conf (cluster_1)
#------------------------------------------------------------
# set Replication Server information
#------------------------------------------------------------
<Replicate_Server_Info>
        <Host_Name> cluster_1 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> cluster_2 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> cluster_3 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
#-------------------------------------------------------------
# set Cluster DB Server information
#-------------------------------------------------------------
<Host_Name> cluster_1 </Host_Name>
<Recovery_Port> 7001 </Recovery_Port>
<Rsync_Path> /usr/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<Rsync_Compress> yes </Rsync_Compress>
<Pg_Dump_Path>  /usr/local/pgsql/bin/pg_dump </Pg_Dump_Path>
<When_Stand_Alone> read_only </When_Stand_Alone>
<Replication_Timeout> 1min </Replication_Timeout>
<LifeCheck_Timeout> 3s </LifeCheck_Timeout>
<LifeCheck_Interval> 11s </LifeCheck_Interval>

#------------------------------------------------------------
# file: cluster.conf (cluster_2)
#------------------------------------------------------------
# set Replication Server information
#------------------------------------------------------------
<Replicate_Server_Info>
        <Host_Name> cluster_1 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> cluster_2 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> cluster_3 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
#-------------------------------------------------------------
# set Cluster DB Server information
#-------------------------------------------------------------
<Host_Name> cluster_2 </Host_Name>
<Recovery_Port> 7001 </Recovery_Port>
<Rsync_Path> /usr/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<Rsync_Compress> yes </Rsync_Compress>
<Pg_Dump_Path>  /usr/local/pgsql/bin/pg_dump </Pg_Dump_Path>
<When_Stand_Alone> read_only </When_Stand_Alone>
<Replication_Timeout> 1min </Replication_Timeout>
<LifeCheck_Timeout> 3s </LifeCheck_Timeout>
<LifeCheck_Interval> 11s </LifeCheck_Interval>

#------------------------------------------------------------
# file: cluster.conf (cluster_3)
#------------------------------------------------------------
# set Replication Server information
#------------------------------------------------------------
<Replicate_Server_Info>
        <Host_Name> cluster_1 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> cluster_2 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
<Replicate_Server_Info>
        <Host_Name> cluster_3 </Host_Name>
        <Port> 8001 </Port>
        <Recovery_Port> 8101 </Recovery_Port>
</Replicate_Server_Info>
#-------------------------------------------------------------
# set Cluster DB Server information
#-------------------------------------------------------------
<Host_Name> cluster_3 </Host_Name>
<Recovery_Port> 7001 </Recovery_Port>
<Rsync_Path> /usr/bin/rsync </Rsync_Path>
<Rsync_Option> ssh -1 </Rsync_Option>
<Rsync_Compress> yes </Rsync_Compress>
<Pg_Dump_Path>  /usr/local/pgsql/bin/pg_dump </Pg_Dump_Path>
<When_Stand_Alone> read_only </When_Stand_Alone>
<Replication_Timeout> 1min </Replication_Timeout>
<LifeCheck_Timeout> 3s </LifeCheck_Timeout>
<LifeCheck_Interval> 11s </LifeCheck_Interval>

> Please check each /etc/hosts file.
> It's also required same contents.

These are the hosts bfile which are the same on all servers, originally
I only had localhost cluster_1, cluster_2, cluster_3 but added the other
three as there were errrors appearing in the logs that they could not be
found.

127.0.0.1               localhost
192.168.175.67          cluster_1
192.168.175.71          cluster_2
10.35.0.1               cluster_3
192.168.175.67          newcnsgc02.xxx.co.uk
192.168.175.71          newcnsgc04.xxx.co.uk
10.35.0.1               tagish-2.xxx.co.uk



I would greatly appreciate it if you could examine the conf files and
see if you can find any mistakes.

Thank you in advance. Normally, I would not be so desperate, but this
really is the eleventh hour! :-)

John


More information about the Pgcluster-general mailing list