Re: postgres standby won't start

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "Ramalingam, Sankarakumar" <Sankarakumar(dot)Ramalingam(at)elavon(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres standby won't start
Date: 2015-10-08 00:05:51
Message-ID: 5615B35F.5030900@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/07/2015 01:30 PM, Ramalingam, Sankarakumar wrote:
> Hello Adrian,
> Can I use this command so that all the data is streamed directly to the target. Target is pretty much unusable now. Should I get rid of all items under my $PGDATA and leave the empty before doing the following?
>
> pg_basebackup -h <my target hostname> -D <my target host directory> -P -U replication --xlog-method=stream

Just to be sure the target is the standby server, correct?

If so you do not want this:

-h <my target hostname>

-h is for the server you are taking the backup of, or to put it another
way the flow is from -h to -D.

If you are running pg_basebackup on the same machine as the primary then:

pg_basebackup -D <my target host directory> -P -U replication
--xlog-method=stream

This assumes there is only one instance of Postgres running on that
machine and it is running on port 5432. If not then you will need to
specify -p <correct_port>

pg_basebackup is a client program, so like other such programs you have
to tell it what database(cluster) to connect to using the normal
switches, see below. Actually pg_basebackup does not connect to a
specific database but to the database cluster, so any database name you
supply will be ignored.

http://www.postgresql.org/docs/9.4/interactive/app-pgbasebackup.html

"The following command-line options control the database connection
parameters."

>
>
>
> Thanks
> Kumar Ramalingam
> X6015288
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2015-10-08 00:16:33 Re: Issues with german locale on CentOS 5,6,7
Previous Message Thomas Munro 2015-10-07 23:49:54 Re: Issues with german locale on CentOS 5,6,7