Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WZjvP-0001DL-EQ for pgsql-admin@arkaria.postgresql.org; Mon, 14 Apr 2014 16:40:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WZjvO-0004RF-Ns for pgsql-admin@arkaria.postgresql.org; Mon, 14 Apr 2014 16:40:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WZjvN-0004R6-GW for pgsql-admin@postgresql.org; Mon, 14 Apr 2014 16:40:01 +0000 Received: from www.reptiles.org ([198.96.117.3] helo=mailbox.reptiles.org) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WZjvJ-0003BQ-Fe for pgsql-admin@postgresql.org; Mon, 14 Apr 2014 16:40:00 +0000 Received: from localhost by mailbox.reptiles.org via sendmail with STDIO (2689 bytes) (sender: ) (ident using UNIX) id for ; Mon, 14 Apr 2014 12:39:57 -0400 (EDT) (Smail-3.2.0.121 2005-Nov-17 #10 built 2010-Jul-16) Date: Mon, 14 Apr 2014 12:39:57 -0400 From: Jim Mercer To: pgsql-admin@postgresql.org Subject: streaming replication - pgsql 9.2.3 Message-ID: <20140414163956.GA27624@reptiles.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.0 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi, I have set up streaming replication between two servers, using the various walkthroughs the googlepedia found for me. At this point, it certainly seems that the replication is working, and I am able to actually blow away the slave, and have it rebuild, resync and be back in action as a read-only source. I am confused about the purpose and/or point of the WAL files in the context of streaming replication. The documentation seems to be quite insistent that the 'archive_command' should be enabled on the master, and the 'restore_command' should be enabled on the slave. On the master, I made my own script which is fairly pedantic: - copy the WAL file from $PGDATA/pg_xlog into $MASTER:$ARCHDIR - rsync file(s) from $MASTER:$ARCHDIR to $SLAVE:$ARCHDIR - remove copy of file in $MASTER:$ARCHDIR (i don't have a network share between then, so, i am rsyncing) On the slave, I made a similarly pedandic script: - copy the file from $SLAVE:$ARCHDIR to $PGDATA/pg_xlog/RECOVERYXLOG The script on the master runs with regularity, and i am seeing the WAL files show up in $SLAVE:$ARCHDIR however, on the slave side, i'm seeing some issues: - the filename being handed to the script is sometimes for a non-existent file - it appears to be the next file in sequence, but that filename hasn't even been generated on the master yet. - it appears, that if there are multiple files in $SLAVE:$ARCHDIR, they might actually overwrite themselves when copied to pg_xlog/RECOVERYXLOG these are the logs my script is generating, if i do a stop/start of postgres: Apr 14 12:19:20 dt-pgsql-001 archive-slave.sh: notice: rtn=0 - cp [/export/pg-archive/00000001000000220000007F] /export/postgresql/data/main/[pg_xlog/RECOVERYXLOG] Apr 14 12:19:20 dt-pgsql-001 archive-slave.sh: notice: rtn=0 - cp [/export/pg-archive/000000010000002200000080] /export/postgresql/data/main/[pg_xlog/RECOVERYXLOG] Apr 14 12:19:23 dt-pgsql-001 archive-slave.sh: error: no such file[/export/pg-archive/000000010000002200000081] Apr 14 12:19:23 dt-pgsql-001 archive-slave.sh: error: no such file[/export/pg-archive/000000010000002200000081] am i doing something wrong? please advise. -- Jim Mercer Reptilian Research jim@reptiles.org +1 416 410-5633 "He who dies with the most toys is nonetheless dead" -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin