Postgresql with c3p0 - failover

我怕爱的太早我们不能终老 提交于 2019-12-11 13:13:34

问题


We're using currently c3p0 with postgresql.

Does c3p0 supports any fail-over mechanisms (no info in documentation so I assume that unfortunately no)?

I've found that mysql,oracle and ms sql supports some failover options in jdbc url, e.g. jdbcUrl="jdbc:sqlserver://mainserver:1433;failoverPartner=backupserver;

Are pgpool and pgpool-II only posibilities for postgresql?


回答1:


I don't know of any built-in failover in either the JDBC driver or the PostgreSQL core

Other options besides pgpool-II are:

  • pgBouncer
  • HA-JDBC (although I'm not sure how active that still is)

A complete(?) overview of all solutions is available in the Postgres wiki:

http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling




回答2:


As of Version 9.2-1000 (2012-09-27) the postgres jdbc4 drivers support failover urls (although it isn't well documented in the api) postgres jdbc Changelog

As:

jdbc:postgresql://masterHost:port,slaveHost:port/db_name


来源:https://stackoverflow.com/questions/8080050/postgresql-with-c3p0-failover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!