Master/Slave Replication with Down Slaves
Posted by: Chuck Syperski
Date: June 21, 2017 07:06AM

Hello,

I am attempting to use the com.mysql.jdbc.ReplicationDriver on a web application and everything works great when my code/system is on the "happy path". My reads go to the replicas, my writes go to the master. My problem is that I might be misunderstanding how the driver is supposed to operate when a slave goes down. I am current using tomcat to manage the connection pool and here is my config....

<Resource auth="Container"
driverClassName="com.mysql.jdbc.ReplicationDriver"
defaultAutoCommit="false"
initialSize="3"
logAbandoned="false"
maxActive="200"
maxIdle="10"
maxWait="10000"
name="jdbc/mydb"
removeAbandoned="true"
testOnBorrow="true"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
username="username"
password="password"
url="jdbc:mysql:replication://localhost:3306,2.2.2.222:3306/mydb?autoReconnect=true&amp;allowSlaveDownConnections=true&amp;readFromMasterWhenNoSlaves=true&amp;connectTimeout=15000&amp;socketTimeout=15000"
validationQuery="/* ping */ SELECT 1"/>


My issue is that:

1. Tomcat won't start when the slave 2.2.2.222 is down. Is there a setting to allow for this?

2. If a node goes down at any point does the driver blacklist them, because it seems if a kill a node that my application hangs on queries that are going to the read only replica. Is there a way to have it ban failed nodes?

I guess in general does Master/Slave Replication gracefully handle failed slave nodes?

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Master/Slave Replication with Down Slaves
June 21, 2017 07:06AM


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.