Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
2.2, 2.2.3
-
None
-
CentOS , MaxScale
Description
With the router_options set to slave,master , accessing node gives an error below "MySQL server has gone away" [Master & Slave node are up and running].
|
[root@maxscale ~]# maxadmin
|
MaxScale> list servers
|
Servers.
|
-------------------+-----------------+-------+-------------+--------------------
|
Server | Address | Port | Connections | Status
|
-------------------+-----------------+-------+-------------+--------------------
|
master-node | 192.168.207.207 | 3306 | 0 | Master, Running
|
slave-node | 192.168.207.206 | 3306 | 0 | Slave, Running
|
-------------------+-----------------+-------+-------------+--------------------
|
MaxScale>
|
|
|
[root@maxscale ~]# mysql -u maxmon -pmaxmon -h 192.168.207.158 -e "select @@hostname" --port=3399
|
ERROR 2006 (HY000) at line 1: MySQL server has gone away
|
If Slave-node is stop (Service mysql stop) then all read queries are directing to the master-node.
|
[root@maxscale ~]# maxadmin
|
MaxScale> list servers
|
Servers.
|
-------------------+-----------------+-------+-------------+--------------------
|
Server | Address | Port | Connections | Status
|
-------------------+-----------------+-------+-------------+--------------------
|
master-node | 192.168.207.207 | 3306 | 0 | Master, Running
|
slave-node | 192.168.207.206 | 3306 | 0 | Down
|
-------------------+-----------------+-------+-------------+--------------------
|
|
|
[root@maxscale ~]# mysql -u maxmon -pmaxmon -h 192.168.207.158 -e "select @@hostname" --port=3399
|
+-------------+
|
| @@hostname |
|
+-------------+
|
| master-node |
|
+-------------+
|
When we remove the slave option from the router_options i.e router_options=master then it only goes to the Master (Which is as expected )
|
MaxScale> list servers
|
Servers.
|
-------------------+-----------------+-------+-------------+--------------------
|
Server | Address | Port | Connections | Status
|
-------------------+-----------------+-------+-------------+--------------------
|
master-node | 192.168.207.207 | 3306 | 0 | Master, Running
|
slave-node | 192.168.207.206 | 3306 | 0 | Slave, Running
|
-------------------+-----------------+-------+-------------+--------------------
|
|
[root@maxscale ~]# mysql -u maxmon -pmaxmon -h 192.168.207.158 -e "select @@hostname" --port=3399
|
+-------------+
|
| @@hostname |
|
+-------------+
|
| master-node |
|
+-------------+
|
When we remove the master option from the router_options i.e router_options=slave then it only goes to the Slave (Which is as expected )
|
[root@maxscale ~]# maxadmin
|
MaxScale> list servers
|
Servers.
|
-------------------+-----------------+-------+-------------+--------------------
|
Server | Address | Port | Connections | Status
|
-------------------+-----------------+-------+-------------+--------------------
|
master-node | 192.168.207.207 | 3306 | 0 | Master, Running
|
slave-node | 192.168.207.206 | 3306 | 0 | Slave, Running
|
-------------------+-----------------+-------+-------------+--------------------
|
|
|
[root@maxscale ~]# mysql -u maxmon -pmaxmon -h 192.168.207.158 -e "select @@hostname" --port=3399
|
+------------+
|
| @@hostname |
|
+------------+
|
| slave-node |
|
+------------+
|
Is there a way that will enforce a round-robin between Master-node and Slave-Node?
|