<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt"><div>This is what the recovery.conf looks like.</div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">*******************************************</div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">#recovery_target_timeline = 'latest'</div><div>standby_mode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 'on'</div><div>primary_conninfo &nbsp; &nbsp; &nbsp;= 'host=postgres-p.rolta.com port=5432 user=postgres'</div><div><span></span></div><div>trigger_file = '/var/log/pgpool/trigger/trigger_file1'</div><div>********************************************************<br></div><div style="color: rgb(0, 0, 0); font-size: 19px;
 font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">The basebackup.sh on both postgres databases is as follows</div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="background-color: transparent;">**************************************************</span><br></div><div style="background-color: transparent;">#/bin/sh -x</div><div style="background-color: transparent;">#</div><div style="background-color: transparent;"># XXX We assume master
 and recovery host uses the same port number</div><div style="background-color: transparent;">PORT=5432</div><div style="background-color: transparent;">master_node_host_name=`hostname`</div><div style="background-color: transparent;">master_db_cluster=$1</div><div style="background-color: transparent;">recovery_node_host_name=$2</div><div style="background-color: transparent;">recovery_db_cluster=$3</div><div style="background-color: transparent;">tmp=/tmp/mytemp$$</div><div style="background-color: transparent;">trap "rm -f $tmp" 0 1 2 3 15</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication', true)" postgres</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">rsync -C -a -c --delete --exclude postgresql.conf --exclude postmaster.pid \</div><div style="background-color:
 transparent;">--exclude postmaster.opts --exclude pg_log \</div><div style="background-color: transparent;">--exclude recovery.conf --exclude recovery.done \</div><div style="background-color: transparent;">--exclude pg_xlog \</div><div style="background-color: transparent;">$master_db_cluster/ $recovery_node_host_name:$recovery_db_cluster</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">ssh -T $recovery_node_host_name mkdir $recovery_db_cluster/pg_xlog</div><div style="background-color: transparent;">ssh -T $recovery_node_host_name chmod 700 $recovery_db_cluster/pg_xlog</div><div style="background-color: transparent;">ssh -T $recovery_node_host_name rm -f $recovery_db_cluster/recovery.done</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">cat &gt; $tmp &lt;&lt;EOF</div><div style="background-color: transparent;">#recovery_target_timeline =
 'latest'</div><div style="background-color: transparent;">standby_mode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 'on'</div><div style="background-color: transparent;">primary_conninfo &nbsp; &nbsp; &nbsp;= 'host=$master_node_host_name port=$PORT user=postgres'</div><div style="background-color: transparent;">trigger_file = '/var/log/pgpool/trigger/trigger_file1'</div><div style="background-color: transparent;">EOF</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">scp $tmp $recovery_node_host_name:$recovery_db_cluster/recovery.conf</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">psql -p $PORT -c "SELECT pg_stop_backup()" postgres</div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style:
 normal;">***********************************************</div><div></div><div>&nbsp;</div><div>Thanks and Regards,</div><div><span style="font-size: 14pt;">Syed Irfan.</span><br></div><div><span style="font-size: 14pt;">Sr. Developer</span><br></div><div><br></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Thursday, 23 January 2014 11:07 PM, Jeff Frost &lt;jeff@pgexperts.com&gt; wrote:<br> </font> </div>  <div class="y_msg_container"><div id="yiv7749124090"><div><br><div><div>On Jan 23, 2014, at 9:32 AM, Syed Irfan &lt;<a rel="nofollow" ymailto="mailto:syedirfan_77@yahoo.com" target="_blank" href="mailto:syedirfan_77@yahoo.com">syedirfan_77@yahoo.com</a>&gt; wrote:</div><br
 class="yiv7749124090Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Dear Tatsuo Ishii,</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">&nbsp; &nbsp; &nbsp; &nbsp;I am still awaiting for your reply on this issue, I have tried your suggestions but still I am unable to
 successfully run the Recovery process the third time it's surprises me how does it work the first time but same thing fails in the third attempt.?</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">The Postgres log shows as below</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br></div><div style="font-family:
 Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><blockquote type="cite"><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 14pt;"><div class="yiv7749124090yahoo_quoted" style="display: block;"><div style="font-size:14pt;"><div style="font-size:12pt;"><div class="yiv7749124090y_msg_container"><div id="yiv7749124090"><div style="font-size:14pt;"><div class="yiv7749124090yqt0803422773" id="yiv7749124090yqt11547"><div class="yiv7749124090yahoo_quoted"><div
 style="font-size:14pt;"><div style="font-size:12pt;"><div class="yiv7749124090y_msg_container">&gt;&gt; 28038 2014-01-09 21:28:33 BDT FATAL:&nbsp; timeline 35 of the primary does not match recovery target timeline 36<br clear="none">&gt;&gt; 28039 2014-01-09 21:28:38 BDT FATAL:&nbsp; timeline 35 of the primary does not match recovery target timeline 36</div></div></div></div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div><br></div>I urgently request you to help me in this impending issue.</div><br class="yiv7749124090Apple-interchange-newline"></blockquote></div><div><br></div><div>This is usually caused by postgres trying to replay WAL files from the wrong source. &nbsp;Did you clean out the pg_xlog directory on the replica before taking the base backup?</div><div><br></div><div>What does your recovery.conf look like?</div><div><br></div><div><br></div></div></div><br><br></div>  </div> </div>  </div>
 </div></body></html>