Re: 9.1.3: launching streaming replication

From: "Welty, Richard" <rwelty(at)ltionline(dot)com>
To: "Michael Nolan" <htfoot(at)gmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.1.3: launching streaming replication
Date: 2012-04-03 15:42:24
Message-ID: C35FDD5FDF7E584991A6AAF8F1A8425F0226ACEB@ltischx01.lti.int
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-general

thanks for the suggestions. the light has gone on and i have it working as of about 15 minutes ago. i'm going to revisit the documentation and possibly make suggestions about making things a little clearer, or else issue a mea culpa about my reading comprehension. don't know which just yet.

richard

-----Original Message-----
From: Michael Nolan [mailto:htfoot(at)gmail(dot)com]
Sent: Mon 4/2/2012 7:19 PM
To: Welty, Richard
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] 9.1.3: launching streaming replication

On Mon, Apr 2, 2012 at 4:21 PM, Welty, Richard <rwelty(at)ltionline(dot)com> wrote:

I got similar messages the first few times I tried to start up my slave
server, I never did figure out exactly what caused it.

You can either delete all the files on the slave and try again, or do what
I did, write a script that handles transferring just the files needed to
resync the slave.

Here's the script I've been using to transfer the files between my two
servers to resync them. This is not a production-ready script.

I have a second tablespace, so there are two 'data' transfers plus the xlog
transfer. (You may run into issues transferring the pg_tblspc directory,
as I did, hence the '-safe-links' parameter.) The '-delete' term deletes
any files on the slave that aren't on the server, unless you list them in
an '--exclude' clause.)

/usr/local/pgsql/bin/psql -c "select pg_start_backup('tardir',true)"
postgres postgres

rsync -av --exclude log.out --exclude postgresql.conf \
--exclude postgresql.pid --delete --exclude pg_hba.conf \
--exclude pg_xlog --exclude server.crt --exclude server.key \
--exclude restore.conf --exclude restore.done \
--safe-links /usr/local/pgsql/data/ postgres(at)xxx:/usr/local/pgsql/data

rsync -av /usr/local/pgsql/data2/ postgres(at)xxx:/usr/local/pgsql/data2

/usr/local/pgsql/bin/psql -c "select pg_stop_backup()" postgres postgres

rsync -av /usr/local/pgsql/data/pg_xlog postgres(at)xxx:/usr/local/pgsql/data/

echo "ok to start standby"

--
Mike Nolan

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Robert Haas 2012-04-03 17:32:10 Re: Idea on indexes
Previous Message Michael Nolan 2012-04-02 23:29:34 Re: 9.1.3: launching streaming replication

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2012-04-03 15:56:26 Re: Switching to Homebrew as recommended Mac install?
Previous Message leaf_yxj 2012-04-03 15:27:24 Re: Please help me to take a look of the erros in my functions. Thanks.