[Pgcluster-general] Replication works :) but only one way :(

indra wardhana kakuz2 at suryasoft.net
Thu Nov 29 01:37:08 UTC 2007


On 11/28/2007, "Simon Bérubé" <sberube at accedian.com> wrote:

>Hi everyone,
>
>I just installed PgCluster and my replication works for the moment,
>but only in one way ?!?. I think I setup the thing correctly. The user
>for replication can login without password on the other database host
>and vice-versa, my server have consitent DNS name and RSYNC and SSh
>without pass authentification (with public/private keys) works great.
>For the moment, when I update or insert a new row in the database on
>server1, the row is replicated perfectly on the server2 database, wich
>is correct, but when I update or insert a new row on server2 nothing
>append on server1, it's seem that the replication server (pgreplicate)
>situated on server1 is nerver notice. I "tail" the log of pgreplicate
>and nothing is written about a "update or insert request from
>server2".
>
>For the moment, server1 host the database (postgresql) I want to
>replicate and also the replication server (pgreplicate), server2 just
>run the database (postgresql). So, server1 has a configuration file
>for the cluster node (cluster.conf) and another one for the
>replication server (pgreplicate.conf). Server2 has just one
>configuration file for the cluster node (cluster.conf). Note that I
>didn't use load balancer at all. There is my configuration file for
>each server
>
>#### SERVER_1 ####
>
>==== cluster.conf ====
>
><Replicate_Server_Info>
>  <Host_Name> server1.accedian.local </Host_Name>
>  <Port> 8001 </Port>
>  <Recovery_Port> 8101 </Recovery_Port>
></Replicate_Server_Info>
>
><Host_Name> 		server1.accedian.local 	</Host_Name>
><Recovery_Port> 	                7001 			</Recovery_Port>
><Rsync_Path> 		/usr/bin/rsync 		</Rsync_Path>
><Rsync_Option> 		ssh -2 			</Rsync_Option>
><Rsync_Compress> 	                yes 			</Rsync_Compress>
><Pg_Dump_Path>		/usr/local/pgsql/bin/pg_dump 	</Pg_Dump_Path>
><When_Stand_Alone> 	read_write			</When_Stand_Alone>
><Replication_Timeout> 	1min 			</Replication_Timeout>
><LifeCheck_Timeout> 	3s			</LifeCheck_Timeout>
><LifeCheck_Interval> 	                11s 			</LifeCheck_Interval>
>
>==== pgreplicate.conf ====
>
><Cluster_Server_Info>
>  <Host_Name>	  server1.accedian.local	</Host_Name>
>  <Port>	                  5432	      	 	</Port>
>  <Recovery_Port>       7001	  	 	</Recovery_Port>
></Cluster_Server_Info>
>
><Cluster_Server_Info>
>  <Host_Name>          server2.accedian.local 	</Host_Name>
>  <Port>                     5432	       	 	</Port>
>  <Recovery_Port>      7001         	 	</Recovery_Port>
></Cluster_Server_Info>
>
><Host_Name>               server1.accedian.local             </Host_Name>
><Replication_Port>        8001        	                 </Replication_Port>
><Recovery_Port>           8101        		 </Recovery_Port>
><RLOG_Port>               8301        		 </RLOG_Port>
><Response_Mode>        reliable      		 </Response_Mode>
><Use_Replication_Log>  yes		                 </Use_Replication_Log>
><Replication_Timeout>  1min       		 </Replication_Timeout>
><LifeCheck_Timeout>    3s  		                 </LifeCheck_Timeout>
><LifeCheck_Interval>      15s        		 </LifeCheck_Interval>
>
><Log_File_Info>
>  <File_Name>	/usr/local/pgsql/data/pgreplicate.log	</File_Name>
>  <File_Size>	10M				</File_Size>
>  <Rotate>	                 3				</Rotate>
></Log_File_Info>
>
>
>#### SERVER_2 ####
>
>==== cluster.conf ====
>
><Replicate_Server_Info>
>  <Host_Name> 	server1.accedian.local 	</Host_Name>
>  <Port> 		8001 			</Port>
>  <Recovery_Port>     8101 			</Recovery_Port>
></Replicate_Server_Info>
>
><Host_Name>      	                server2.accedian.local	</Host_Name>
><Recovery_Port>		7001			</Recovery_Port>
><Rsync_Path>		/usr/bin/rsync		</Rsync_Path>
><Rsync_Option>		ssh -2			</Rsync_Option>
><Rsync_Compress>	                yes			</Rsync_Compress>
><Pg_Dump_Path>		/usr/local/pgsql/bin/pg_dump	</Pg_Dump_Path>
><When_Stand_Alone>	read_write			</When_Stand_Alone>
><Replication_Timeout>	1min			</Replication_Timeout>
><LifeCheck_Timeout>	                3s			</LifeCheck_Timeout>
><LifeCheck_Interval>	                11s			</LifeCheck_Interval>
>
>
>Also, the configuration file for identifing the hosts (/etc/hosts) are
>configurated correctly. There they are :
>
>#### SERVER_1 ####
>
>==== /etc/hosts ====
>
>127.0.0.1	                localhost
>127.0.0.1	                server1.accedian.local	server1
>192.168.10.40	server1.accedian.local	server1
>192.168.10.41	server2.accedian.local	server2
>
>#### SERVER_2 ####
>
>==== /etc/hosts ====
>
>127.0.0.1	                localhost
>127.0.0.1	                server2.accedian.local	server2
>192.168.10.41	server2.accedian.local	server2
>192.168.10.40	server1.accedian.local	server1
>
>Last question... do I need to start a instance of pgreplicate on each
>database node ?!? (one on server1 and one on server2)
>Thanks,
>
>Simon Berube
>IT Consultant,
>Accedian Networks Inc,
>http://www.accedian.com
>
>P-S: Sorry for my poor english, is not my first language, but I need
>to make it working, I need to prove to my boss that not just Microsoft
>SQL Server exists ;)

how about ur pg_hba.conf and postgresql.conf
try to running pgreplicate on verbose mode, it will display more log

>_______________________________________________
>Pgcluster-general mailing list
>Pgcluster-general at pgfoundry.org
>http://pgfoundry.org/mailman/listinfo/pgcluster-general


More information about the Pgcluster-general mailing list