This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-17. For the latest, interactive version please visit https://mariadb.com/kb/.

error : (408595) Lost connection to the master server

i find many error in the log file.

-------------------------------

2019-06-24 19:13:25   notice : Initialise the MariaDB Monitor module.
2019-06-24 19:13:25   notice : Loaded module mariadbmon: V1.5.0 from /usr/lib64/maxscale/libmariadbmon.so
2019-06-24 19:13:25   warning: The parameter 'passwd' is deprecated: use 'password' instead
2019-06-24 19:13:25   warning: Protocol module 'mysqlbackend' has been deprecated, use 'mariadbbackend' instead.
2019-06-24 19:13:25   notice : Loaded module mariadbbackend: V2.0.0 from /usr/lib64/maxscale/libmariadbbackend.so
2019-06-24 19:13:25   notice : Loaded module MySQLBackendAuth: V1.0.0 from /usr/lib64/maxscale/libmysqlbackendauth.so
2019-06-24 19:13:25   notice : Loaded module MySQLAuth: V1.1.0 from /usr/lib64/maxscale/libmysqlauth.so
2019-06-24 19:13:25   notice : Loaded module MaxAdminAuth: V2.1.0 from /usr/lib64/maxscale/libmaxadminauth.so
2019-06-24 19:13:25   notice : Housekeeper thread started.
2019-06-24 19:13:25   notice : Encrypted password file /var/lib/maxscale/.secrets can't be accessed (No such file or directory). Password encryption is not used.
2019-06-24 19:13:25   error  : Unknown journal schema version: 1
2019-06-24 19:13:25   notice : Starting a total of 2 services...
2019-06-24 19:13:25   notice : Selecting new master server.
2019-06-24 19:13:25   notice : Setting 'server1' as master.
2019-06-24 19:13:25   notice : Server changed state: server1[172.31.8.18:3306]: new_master. [Running] -> [Master, Running]
2019-06-24 19:13:25   notice : Server changed state: server2[172.31.8.19:3306]: new_slave. [Running] -> [Relay Master, Slave, Running]
2019-06-24 19:13:25   notice : [Read-Write-Service] Loaded 7 MySQL users for listener Read-Write-Listener.
2019-06-24 19:13:25   notice : Listening for connections at [0.0.0.0]:3306 with protocol MySQL
2019-06-24 19:13:25   notice : Service 'Read-Write-Service' started (1/2)
2019-06-24 19:13:25   notice : Listening for connections at [/var/run/maxscale/maxadmin.sock]:0 with protocol MaxScale Admin
2019-06-24 19:13:25   notice : Service 'MaxAdmin-Service' started (2/2)
2019-06-24 19:13:25   notice : Started REST API on [127.0.0.1]:8989
2019-06-24 19:13:25   notice : MaxScale started with 8 worker threads, each with a stack size of 8388608 bytes.
2019-06-24 19:20:24   error  : (751) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (759) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (756) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (761) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (768) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (762) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (774) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 seconds. Error caused by: #HY000: Lost connection to backend server.
2019-06-24 19:20:24   error  : (775) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has 
been idle for 299.6 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 Answered by Markus Mäkelä in this comment.

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.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.