MariaDB 每 30 分钟自动关闭一次

MariaDB 每 30 分钟自动关闭一次

MariaDB 服务 30 分钟后自动关闭。

它是一个 VPS,12 vCPU,12 GB RAM。CentOS 7、Webmin、Virtualmin、5.5.60-MariaDB、PHP 7.2、Apache 2。

日志中没有错误,CPU 平均负载为 10%。

我创建了一个 bash 脚本来检查并在发生故障时重新启动它,但这会导致繁忙的站点停机大约一分钟。

欢迎任何建议和想法!

Version: '5.5.60-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server 
181215 10:11:46 [Note] /usr/libexec/mysqld: Normal shutdown 
181215 10:11:46 [Note] Event Scheduler: Purging the queue. 0 events 
181215 10:11:46  InnoDB: Starting shutdown... 
181215 10:11:51  InnoDB: Shutdown completed; log sequence number 62284182262 
181215 10:11:51 [Note] /usr/libexec/mysqld: Shutdown complete

181215 10:11:52 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 
181215 10:11:52 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 
181215 10:11:52 [Note] /usr/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 3233 ... 
181215 10:11:52 [Warning] Could not increase number of max_open_files to more than 1024 (request: 2035) 
181215 10:11:52 InnoDB: The InnoDB memory heap is disabled 
181215 10:11:52 InnoDB: Mutexes and rw_locks use GCC atomic builtins 181215 10:11:52 InnoDB: Compressed tables use zlib 1.2.7 
181215 10:11:52 InnoDB: Using Linux native AIO 181215 10:11:52 InnoDB: Initializing buffer pool, size =
128.0M 
181215 10:11:52 InnoDB: Completed initialization of buffer pool 
181215 10:11:52 InnoDB: highest supported file format is Barracuda. 
181215 10:11:52  InnoDB: Waiting for the background threads to start 
181215 10:11:53 Percona XtraDB (http://www.percona.com)
5.5.59-MariaDB-38.11 started; log sequence number 62284182262 
181215 10:11:53 [Note] Plugin 'FEEDBACK' is disabled. 
181215 10:11:53 [Note] Server socket created on IP: '0.0.0.0'. 
181215 10:11:53 [Note] Event Scheduler: Loaded 0 events 
181215 10:11:53 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.5.60-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server 181215 10:42:51 [Note] /usr/libexec/mysqld: Normal shutdown 
181215 10:42:51 [Note] Event Scheduler: Purging the queue. 0 events 
181215 10:42:51  InnoDB: Starting shutdown... 
181215 10:42:53  InnoDB: Shutdown completed; log sequence number 62285727771 
181215 10:42:53 [Note] /usr/libexec/mysqld: Shutdown complete

181215 10:42:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 
181215 10:42:55 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 
181215 10:42:55 [Note] /usr/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 21213 ... 
181215 10:42:55 [Warning] Could not increase number of max_open_files to more than 1024 (request: 2035) 
181215 10:42:55 InnoDB: The InnoDB memory heap is disabled 
181215 10:42:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
181215 10:42:55 InnoDB: Compressed tables use zlib 1.2.7 181215 10:42:55 InnoDB: Using Linux native AIO 181215 10:42:55 InnoDB: Initializing buffer pool, size =
128.0M 
181215 10:42:55 InnoDB: Completed initialization of buffer pool 
181215 10:42:55 InnoDB: highest supported file format is Barracuda. 
181215 10:42:55  InnoDB: Waiting for the background threads to start 
181215 10:42:56 Percona XtraDB (http://www.percona.com)
5.5.59-MariaDB-38.11 started; log sequence number 62285727771 
181215 10:42:56 [Note] Plugin 'FEEDBACK' is disabled. 
181215 10:42:56 [Note] Server socket created on IP: '0.0.0.0'. 
181215 10:42:56 [Note] Event Scheduler: Loaded 0 events 181215 10:42:56 [Note] /usr/libexec/mysqld: ready for connections.

/etc/my.cnf 内容:

[mysqld]
open_files_limit=1024000 
open-files-limit = 1024000 
datadir=/var/lib/mysql 
socket=/var/lib/mysql/mysql.sock 
innodb_buffer_pool_size=64M 
symbolic-links=0 
innodb_file_per_table = 1 
thread_concurrency = 8 
query_cache_size = 32M 
thread_cache_size = 8 
myisam_sort_buffer_size = 64M 
read_rnd_buffer_size = 8M 
read_buffer_size = 2M 
sort_buffer_size = 2M 
table_open_cache = 512 
max_allowed_packet=256M 
key_buffer_size = 384M 
big-tables 
default-storage-engine = MyISAM 
tmp_table_size=256M 
max_heap_table_size=512M 
local-infile=0 
max_connections=100 
wait_timeout=60


[mysqld_safe] 
log-error=/var/log/mariadb/mariadb.log 
pid-file=/var/run/mariadb/mariadb.pid 
open_files_limit = 102400 
open-files-limit = 102400 
socket=/var/lib/mysql/mysql.sock 
innodb_buffer_pool_size=64M

!includedir /etc/my.cnf.d

答案1

在没有看到您的系统和/或用户crontab文件或任何查询日志的情况下,并且考虑到关机似乎没有在启动后几乎恰好 31 分钟发生(并且不是恰好在分钟或接近分钟,例如 10:42:00,就像从或那样cronat,我想象有一个查询是在服务器本地或从客户端或应用程序远程发出的。

Percona 的 Robert Barabas 撰文优秀的诊断站查找可能导致 MySQL 守护进程随机关闭的原因;然后,调高查询日志的音量,这应该有助于您找到罪魁祸首。

相关内容