MySQL 如何选择向哪个从站发送查询?
How does MySQL pick which slave to send query to?
假设我有一个 JDBC url 这样的...
jdbc:mysql:replication://master,slave1,slave2,slave3/<database>
MySQL如何决定向哪个slave发送读请求?
它是循环法还是做任何更聪明的事情,例如检查哪个具有最低延迟(如果我的奴隶分布在不同地区的数据中心怎么办)?
谢谢
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-master-slave-replication-connection.html 说:
An application signals that it wants a transaction to be read-only by calling Connection.setReadOnly(true). The replication-aware connection will use one of the slave connections, which are load-balanced per slave host using a round-robin scheme.
(强调我的)
假设我有一个 JDBC url 这样的...
jdbc:mysql:replication://master,slave1,slave2,slave3/<database>
MySQL如何决定向哪个slave发送读请求? 它是循环法还是做任何更聪明的事情,例如检查哪个具有最低延迟(如果我的奴隶分布在不同地区的数据中心怎么办)?
谢谢
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-master-slave-replication-connection.html 说:
An application signals that it wants a transaction to be read-only by calling Connection.setReadOnly(true). The replication-aware connection will use one of the slave connections, which are load-balanced per slave host using a round-robin scheme.
(强调我的)