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 10:49AM

Hi Pavan,

Good that you have it working.

Let me just add a few observations.
- By using the sub-protocol 'jdbc:mysql://' you are using a plain fail-over setup. This means that the first host will be the one that will be always used until it fails, in which case it "jumps" to the second host, if the second fails then it "jumps" to the third and so on in a round-robin basis. Mind that there is no load-balancing here.
- The property 'allowMasterDownConnections' has no effect here, it's used only in 'jdbc:mysql:replication://' connections.
- The property 'allowSlaveDownConnections' has no effect here, it's used only in
'jdbc:mysql:replication://' connections.
- The property 'readFromMasterWhenNoSlaves' has no effect here, it's used only in 'jdbc:mysql:replication://' connections.
- The property 'loadBalanceBlacklistTimeout' has no effect here, it's used in 'jdbc:mysql:loadbalance://' or 'jdbc:mysql:replication://' connections.
(Note that any property specific for load-balancing connections also works on replication-aware connections since the replication-aware connections are supported by two internal load-balancing connections - one for the master(s), another for slave(s)).
- If you want to take advantage of the load-balancing features in Connector/J you'd have to use either load-balancing connections or replication-aware connections. The first if all your servers stand at the same level and all are read/write able, or the second if the master(s) is read/write able and the slave(s) is read-only. In both cases you would take advantage of real load balancing, as opposed to simple fail-over. On replication-aware connections the load-balancing feature applies to each sub-group of hosts (master(s) vs slaves) not between master and slaves, for which you can setup a fail-over behavior by setting the above properties.

Again, I hope this 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 10:49AM


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.