From: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: kaprikorn07 <bharath.spyk@gmail.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Failover Datasource?
Date: Wed, 12 Dec 2012 17:06:06 +0200
Message-ID: <50C89D5E.1020908@nitorcreations.com> (raw)
In-Reply-To: <CADK3HHLYQJufB9gzLUXQmOdOKetvN5LgXTnEttFnw1TBGQ3aDw@mail.gmail.com>
References: <4DFA5A86.9030301@acm.org>
<itdn5g$eu7$1@dough.gmane.org>
<4DFA671F.2050005@acm.org>
<4DFA9704.4000209@hogranch.com>
<4DFAB403.5010309@acm.org>
<4DFAB5B8.5010603@hogranch.com>
<4DFAB9E2.4070905@acm.org>
<1334056170219-5629626.post@n5.nabble.com>
<1355303340886-5736270.post@n5.nabble.com>
<51061EFB789B4A45AC6598C83649B7BE9B687C10@NBL-EXCD1-01.nebula.local>
<CADK3HHLYQJufB9gzLUXQmOdOKetvN5LgXTnEttFnw1TBGQ3aDw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On 12/12/2012 12:49 PM, Dave Cramer wrote:
> Mikko,
>
> I can't recall did you ever provide a documentation patch for this ?
I'm not sure, but I still found the patch that I was supposed to send... attached.
-Mikko
> On Wed, Dec 12, 2012 at 5:41 AM, Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com <mailto:Mikko.Tiihonen@nitorcreations.com>> wrote:
>
> With latest jdbc drivers you can simply configure multiple host:port pairs in the url separated by comma:
>
> jdbc:postgresql://host1:port1,host2:port2/test
>
> It has only the most basic failover support. When a new connection is opened the hosts are tried in round-robin until a connection is successfully established.
>
> -Mikko
> ________________________________________
> From: pgsql-jdbc-owner@postgresql.org <mailto:pgsql-jdbc-owner@postgresql.org> [pgsql-jdbc-owner@postgresql.org <mailto:pgsql-jdbc-owner@postgresql.org>] on
> behalf of kaprikorn07 [bharath.spyk@gmail.com <mailto:bharath.spyk@gmail.com>]
> Sent: 12 December 2012 11:09
> To: pgsql-jdbc@postgresql.org <mailto:pgsql-jdbc@postgresql.org>
> Subject: Re: [JDBC] Failover Datasource?
>
> Hi All,
>
> As Bruce Adams has mentioned, please let me know if there is any other way
> to do it other than pgBouncer and pgPool.
>
> Please help!
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/Re-Failover-Datasource-tp4496411p5736270.html
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org <mailto:pgsql-jdbc@postgresql.org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org <mailto:pgsql-jdbc@postgresql.org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
>
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbcAttachments:connection-failover-documentation.patch (text/x-patch, 1.4K) downloaddiff --git a/doc/pgjdbc.xml b/doc/pgjdbc.xmlindex a13d320..10d7e5f 100644--- a/doc/pgjdbc.xml+++ b/doc/pgjdbc.xml@@ -812,6 +812,31 @@ openssl pkcs8 -topk8 -in client.key -out client.pk8 -outform DER -v1 PBE-SHA1-3D
</sect2>
+ <sect2 id="connection-failover">+ <title>Connection Fail-over</title>++ <para>+ To support simple connection fail-over it is possible to define multiple+ endpoints (host and port pairs) in the connection url separated by commas.+ The driver will try to once connect to each of them in order until the+ connection succeeds. If none succeed, a normal connection exception is+ thrown.+ </para>+ <para>+ The syntax for the connection url is:+ <synopsis>+jdbc:postgresql://<replaceable class="parameter">host1</replaceable>:<replaceable class="parameter">port1</replaceable>,<replaceable class="parameter">host2</replaceable>:<replaceable class="parameter">port2</replaceable>/<replaceable class="parameter">database</replaceable>+</synopsis>+ </para>++ <para>+ The simple connection fail-over is useful when running against+ a high availability postgres installation that has identical data on each node.+ For example streaming replication postgres that only accepts connection on the master+ node or postgres-xc cluster.+ </para>+ </sect2>+
</sect1>
</chapter>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: mikko.tiihonen@nitorcreations.com, pg@fastcrypt.com, bharath.spyk@gmail.com
Subject: Re: Failover Datasource?
In-Reply-To: <50C89D5E.1020908@nitorcreations.com>
References: <4DFA5A86.9030301@acm.org> <itdn5g$eu7$1@dough.gmane.org> <4DFA671F.2050005@acm.org> <4DFA9704.4000209@hogranch.com> <4DFAB403.5010309@acm.org> <4DFAB5B8.5010603@hogranch.com> <4DFAB9E2.4070905@acm.org> <1334056170219-5629626.post@n5.nabble.com> <1355303340886-5736270.post@n5.nabble.com> <51061EFB789B4A45AC6598C83649B7BE9B687C10@NBL-EXCD1-01.nebula.local> <CADK3HHLYQJufB9gzLUXQmOdOKetvN5LgXTnEttFnw1TBGQ3aDw@mail.gmail.com> <50C89D5E.1020908@nitorcreations.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox