question regarding connection failover URL postgresql 9.6 (master/slave)
От | martin zoldano |
---|---|
Тема | question regarding connection failover URL postgresql 9.6 (master/slave) |
Дата | |
Msg-id | CACmatnZURfQ1C+u7YmRFzw29yy0j6mVAFHSabf7Vy56kh3ENPg@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: question regarding connection failover URL postgresql 9.6 (master/slave)
Re: question regarding connection failover URL postgresql 9.6 (master/slave) |
Список | pgsql-jdbc |
Hello
question regarding connection failover URL postgresql 9.6 (master/slave), when a node( SLAVE per se) does down connections failover MASTER as expected but ONE WAY ONLY!!, if we restart SLQVE service connections never recover back.
stack: postgresql 9.6 (master/slave) + jdbc driver 9.4-1211 + tomcat7 + jdk7 + built-in ConnectionPool
ref: https://jdbc.postgresql.org/documentation/head/connect.html (bottom section)
question regarding connection failover URL postgresql 9.6 (master/slave), when a node( SLAVE per se) does down connections failover MASTER as expected but ONE WAY ONLY!!, if we restart SLQVE service connections never recover back.
stack: postgresql 9.6 (master/slave) + jdbc driver 9.4-1211 + tomcat7 + jdk7 + built-in ConnectionPool
ref: https://jdbc.postgresql.org/documentation/head/connect.html (bottom section)
Issue: upon having MASTER + SLAVE services running , we segregate via two DataSources to point to 1st: MASTER and 2nd:
url="jdbc:postgresql://MASTER:5432,SLAVE:5432/XXDB?targetServerType=preferSlave"
url="jdbc:postgresql://MASTER:5432,SLAVE:5432/XXDB?targetServerType=preferSlave"
when stopping SLAVE service connections failover MASTER as expected, but it seems to be a one way failover, if I restart SLAVE service it never fails back to SLAVE (unless we restart Tomcat service)
I played around with other parameters hostRecheckSeconds and loadBalanceHosts as well as changing order url="SLAVE,MASTER?targetServerType=preferSlave" as well but same thing.
Your helps is extremely appreciated!! thanks in advance.......
В списке pgsql-jdbc по дате отправления: