Re: Speed up Switchover

Поиск
Список
Период
Сортировка
От Sergey Konoplev
Тема Re: Speed up Switchover
Дата
Msg-id CAL_0b1s-FgebjVKMH9RsPGgyGam_8Bxp7_s8fRTJVTterHrsNA@mail.gmail.com
обсуждение исходный текст
Ответ на Speed up Switchover  (TJ <tj@wallago.co.uk>)
Ответы Re: Speed up Switchover  (Samrat Revagade <revagade.samrat@gmail.com>)
Re: Speed up Switchover  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-general
On Thu, Jul 25, 2013 at 1:03 AM, TJ <tj@wallago.co.uk> wrote:
> I am looking for a way of speeding up the process of switching over of
> severs.
> At the moment we are switching over via the trigger file, reconfiguring our
> applications, patching or updating the old primary and rsyncing the data
> over to the old primary.
>
> I was wondering if there was an easier way to get the primary setup as a
> secondary without having to rsync the data as it can take up to 10 hours.

pg_rewind (https://github.com/vmware/pg_rewind) is what you need.

From its docs:

pg_rewind is a tool for synchronizing a PostgreSQL data directory with another
PostgreSQL data directory that was forked from the first one. The result is
equivalent to rsyncing the first data directory (referred to as the old cluster
from now on) with the second one (the new cluster). The advantage of pg_rewind
over rsync is that pg_rewind uses the WAL to determine changed data blocks,
and does not require reading through all files in the cluster. That makes it
a lot faster when the database is large and only a small portion of it differs
between the clusters.


--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

Profile: http://www.linkedin.com/in/grayhemp
Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
Skype: gray-hemp
Jabber: gray.ru@gmail.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Rob Sargent
Дата:
Сообщение: trouble with pam building 9.3beta2
Следующее
От: devonline
Дата:
Сообщение: Re: Tablespace on Postgrsql