Open
Description
SHOW VARIABLES LIKE "version%"
"version","8.0.13",
"version_comment","Source distribution",
"version_compile_machine","aarch64",
"version_compile_os","Linux",
"version_compile_zlib","1.2.11",
"wait_timeout","86400"
After my service starts, I receive a "Disconnected by remote side" message every day (86400 seconds).
logs :
2025-01-14T15:56:55.634928+08:00 400564673 [Note] [MY-010914] [Server] Aborted connection 400564673 to db: 'unconnected' user: 'root' host: '' (failed on flush_net()).
2025-01-14T15:56:55.634628+08:00 400564673 [Note] [MY-011171] [Server] Stop asynchronous binlog_dump to slave (server_id: 100009).
2025-01-15T15:56:59.217796+08:00 669666506 [Note] [MY-010914] [Server] Aborted connection 669666506 to db: 'unconnected' user: 'root' host: '' (failed on flush_net()).
2025-01-15T15:56:59.216858+08:00 669666506 [Note] [MY-011171] [Server] Stop asynchronous binlog_dump to slave (server_id: 100009).
I tried various methods, and eventually, I resolved the issue by setting the following parameters in the code:
private function getBinlogStream(): void
{
$this->checkSum = $this->repository->isCheckSum();
if ($this->checkSum) {
$this->execute('SET @master_binlog_checksum = @@global.binlog_checksum');
}
if (0 !== Config::getHeartbeatPeriod()) {
// master_heartbeat_period is in nanoseconds
$this->execute('SET @master_heartbeat_period = ' . Config::getHeartbeatPeriod() * 1000000000);
}
+ $this->execute('set wait_timeout=9999999');
+ $this->execute('set net_write_timeout=7200');
+ $this->execute('set net_read_timeout=7200');
....
}
Metadata
Metadata
Assignees
Labels
No labels