Re: How to send queries to master and failover to slave ?

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: How to send queries to master and failover to slave ?
Дата
Msg-id 4ae74d8b-2a0e-68fc-93ce-ccbf2abd1744@hogranch.com
обсуждение исходный текст
Ответ на How to send queries to master and failover to slave ?  (Benoit Salotti <benoit.salotti@gmail.com>)
Ответы Re: How to send queries to master and failover to slave ?  (Benoit Salotti <benoit.salotti@gmail.com>)
Re: How to send queries to master and failover to slave ?  (Benoit Salotti <benoit.salotti@gmail.com>)
Список pgsql-jdbc
On 6/28/2016 2:41 AM, Benoit Salotti wrote:
>
> I have a setup with 1 master and 1 slave (hot standy to serve read
> queries if necessary).
> I would like the JDBC driver to talk preferrably to the master (to be
> sure to get the freshest data). If the master is not available I would
> like to send the queries to the slave.
>
> The documentation mentions the following values for the parameter
> targetServerType: any, master, slave, preferSlave.
> I'm surprised there is no preferMaster option which would allow me to
> implement easily my requirement.
>


normally, if the master is not available, that means its failed, and
your HA cluster management will promote the slave to be the new master,
fencing off the old master until it can be manually reset and restored
as the new slave.



--
john r pierce, recycling bits in santa cruz



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

Предыдущее
От: Benoit Salotti
Дата:
Сообщение: How to send queries to master and failover to slave ?
Следующее
От: Mikko Tiihonen
Дата:
Сообщение: Re: How to send queries to master and failover to slave ?