Synchronous replication

Started by John Wiencekabout 10 years ago4 messagesgeneral
Jump to latest
#1John Wiencek
jwiencek3@comcast.net

Is it possible to set up synchronous replication to more that one node in a cluster? Or, am I limited to one synchronous node and one asynchronous node?

Assuming my replicated databases are on nodes: testqa1, testqa2. What would my synchronous_standby_names entry in my postgresql.conf on my master database?

Regards

John Wiencek

#2Joshua D. Drake
jd@commandprompt.com
In reply to: John Wiencek (#1)
Re: Synchronous replication

On 01/13/2016 12:28 PM, jwiencek3@comcast.net wrote:

Is it possible to set up synchronous replication to more that one node
in a cluster? Or, am I limited to one synchronous node and one
asynchronous node?

Yes you can have N number of synchronous slaves. However, be careful. It
can be a huge performance hit.

Assuming my replicated databases are on nodes: testqa1, testqa2. What
would my synchronous_standby_names entry in my postgresql.conf on my
master database?

The IP address that each is binding to.

JD
--
Command Prompt, Inc. http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.

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

#3Thomas Munro
thomas.munro@gmail.com
In reply to: Joshua D. Drake (#2)
Re: Synchronous replication

On Thu, Jan 14, 2016 at 9:34 AM, Joshua D. Drake <jd@commandprompt.com> wrote:

On 01/13/2016 12:28 PM, jwiencek3@comcast.net wrote:

Is it possible to set up synchronous replication to more that one node
in a cluster? Or, am I limited to one synchronous node and one
asynchronous node?

Yes you can have N number of synchronous slaves. However, be careful. It can
be a huge performance hit.

Note that only one of the listed standbys is a synchronous standby at
any given time though. That is, when you commit, the primary server
will wait just for that one server to report that it has fsync'ed the
WAL. (There is a patch being developed to change that so that you
might be able to wait for more than one in a future release).

--
Thomas Munro
http://www.enterprisedb.com

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

#4John Wiencek
jwiencek3@comcast.net
In reply to: Thomas Munro (#3)
Re: Synchronous replication

Thank you all for the quick replies.

John Wiencek

On 1/13/16, 2:43 PM, "Thomas Munro" <thomas.munro@enterprisedb.com> wrote:

On Thu, Jan 14, 2016 at 9:34 AM, Joshua D. Drake <jd@commandprompt.com>
wrote:

On 01/13/2016 12:28 PM, jwiencek3@comcast.net wrote:

Is it possible to set up synchronous replication to more that one node
in a cluster? Or, am I limited to one synchronous node and one
asynchronous node?

Yes you can have N number of synchronous slaves. However, be careful.
It can
be a huge performance hit.

Note that only one of the listed standbys is a synchronous standby at
any given time though. That is, when you commit, the primary server
will wait just for that one server to report that it has fsync'ed the
WAL. (There is a patch being developed to change that so that you
might be able to wait for more than one in a future release).

--
Thomas Munro
http://www.enterprisedb.com

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