Re: MySQL connection does not work when slave db is down using sql connector 5.1.39
Posted by: Filipe Silva
Date: June 01, 2016 02:41AM

Hi Pavan,

Mind that the properties 'allowSlaveDownConnections' and 'readFromMasterWhenNoSlaves' in your connection string are for replication-aware connections only, i.e., for connection strings with sub-protocol 'jdbc:mysql:replication://" and not for load-balancing connections where there is no distinction from masters and slaves servers.

Your connection, however, should be able to succeed if at least one of the hosts is up. Have you tried connecting to each server individually to check if something is wrong in your settings?

You may also want to set the connection property 'retriesAllDown' which has a value of 120. Although this is a security measure, if all your hosts are down or inaccessible it may take some time to actually fail, so you may want to set a low value (say, 1 to 3) to get faster responses. At least while testing.

I hope that helps.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL connection does not work when slave db is down using sql connector 5.1.39
June 01, 2016 02:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.