Search Postgresql Archives

Re: Disable Streaming Replication without restarting either master or slave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 29, 2012 at 7:18 PM, Samba <saasira@xxxxxxxxx> wrote:
> Hi,
>
>
> Is it possible stop/disable streaming replication without stopping or
> restarting either master or slave servers?
>
> Since stopping or restarting the postgres servers would involve complete
> invalidation of the connection pool [Java/JEE app server pool] that may take
> a few minutes before the application becomes usable, it would be great if
> there is a way we can disable replication [for maintenance reasons like
> applying patches or upgrades, etc].

There is no clean way to disable streaming replication. But you can do that
by the following steps:

1. change pg_hba.conf in the master so that the master does not accept new
    replication connection
2. reload pg_hba.conf in the master
3. send SIGTERM signal to currently-running walsender process, e.g., by
    "select pg_terminate_backend(pid) from pg_stat_replication".

Then replication connection will be terminated. The standby tries reconnecting
to the master, but which will continue failing until you'll change pg_hba.conf
again.

Regards,

-- 
Fujii Masao

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux