Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tint4-0002s9-KE for pgsql-jdbc@arkaria.postgresql.org; Wed, 12 Dec 2012 15:06:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tint3-00085M-VM for pgsql-jdbc@arkaria.postgresql.org; Wed, 12 Dec 2012 15:06:18 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tint3-00085H-99 for pgsql-jdbc@postgresql.org; Wed, 12 Dec 2012 15:06:17 +0000 Received: from auth-smtp.nebula.fi ([217.30.180.105]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tint0-0006Ad-Uy for pgsql-jdbc@postgresql.org; Wed, 12 Dec 2012 15:06:16 +0000 Received: from quadvadis.localdomain (gw.nitor.fi [83.145.228.24]) (authenticated bits=0) by auth-smtp.nebula.fi (8.13.8/8.13.4) with ESMTP id qBCF66ns029419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Dec 2012 17:06:07 +0200 Message-ID: <50C89D5E.1020908@nitorcreations.com> Date: Wed, 12 Dec 2012 17:06:06 +0200 From: Mikko Tiihonen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Dave Cramer CC: kaprikorn07 , "pgsql-jdbc@postgresql.org" Subject: Re: Failover Datasource? References: <4DFA5A86.9030301@acm.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> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060809020204060404020609" X-Pg-Spam-Score: -1.5 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------060809020204060404020609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > 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 [pgsql-jdbc-owner@postgresql.org ] on > behalf of kaprikorn07 [bharath.spyk@gmail.com ] > Sent: 12 December 2012 11:09 > To: 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 ) > 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-jdbc > > --------------060809020204060404020609 Content-Type: text/x-patch; name="connection-failover-documentation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="connection-failover-documentation.patch" diff --git a/doc/pgjdbc.xml b/doc/pgjdbc.xml index 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 + + Connection Fail-over + + + 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. + + + The syntax for the connection url is: + +jdbc:postgresql://host1:port1,host2:port2/database + + + + + 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. + + + --------------060809020204060404020609 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc --------------060809020204060404020609--