error : (408595) Lost connection to the master server
i find many error in the log file.
-------------------------------
2019-06-25 13:26:45 error : (420036) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:46 error : (408111) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:46 error : (423094) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:50 error : (416995) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:52 error : (423057) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:55 error : (423558) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:56 error : (408335) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:26:58 error : (423711) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:27:00 error : (423796) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:27:04 error : (423946) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:27:10 error : (424083) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:27:11 error : (424153) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:27:13 error : (423985) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.0 seconds. Error caused by: #HY000: Lost connection to backend server. 2019-06-25 13:27:14 error : (408595) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. A transaction is active and cannot be replayed. Connection has been idle for 299.1 seconds. Error caused by: #HY000: Lost connection to backend server.
-----------------------------
this is the maxscale.cnf
[root@bogon ]# cat /etc/maxscale.cnf
# MaxScale documentation on GitHub: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Documentation-Contents.md # Global parameters # # Complete list of configuration options: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Getting-Started/Configuration-Guide.md [maxscale] threads=auto # Server definitions # # Set the address of the server to the network # address of a MySQL server. # [server1] type=server address=172.31.8.18 port=3306 protocol=MySQLBackend serv_weight=1 # Monitor for the servers # # This will keep MaxScale aware of the state of the servers. # MySQL Monitor documentation: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Monitors/MySQL-Monitor.md [server2] type=server address=172.31.8.19 port=3306 protocol=MySQLBackend serv_weight=1 [MySQL Monitor] type=monitor module=mysqlmon servers=server1,server2 user=admin passwd=JD_810927a monitor_interval=1000 detect_stale_master=true # Service definitions # # Service Definition for a read-only service and # a read/write splitting service. # # ReadConnRoute documentation: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadConnRoute.md #[Read-Only Service] #type=service #router=readconnroute #servers=server1,server2 #user=admin #passwd=E2A448DC3A6AD526D172818A8237ADB2 #router_options=slave # ReadWriteSplit documentation: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadWriteSplit.md [Read-Write Service] type=service router=readwritesplit servers=server1,server2 user=admin #router_options=master_accept_reads=false,master_failure_mode=fail_on_write passwd=JD_810927a max_slave_connections=60% use_sql_variables_in=all auth_all_servers=true # This service enables the use of the MaxAdmin interface # MaxScale administration guide: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Reference/MaxAdmin.md [MaxAdmin Service] type=service router=cli # Listener definitions for the services # # These listeners represent the ports the # services will listen on. # #[Read-Only Listener] #type=listener #service=Read-Only Service #protocol=MySQLClient #port=4008 [Read-Write Listener] type=listener service=Read-Write Service protocol=MySQLClient port=3306 address=0.0.0.0 [MaxAdmin Listener] type=listener service=MaxAdmin Service protocol=maxscaled socket=default #port=6603
Answer
Try increasing it to a higher value:
SET GLOBAL wait_timeout=3600;
That should allow MaxScale enough time to keep the connection alive with the default connection_keepalive of 300 seconds.