![Ubuntu 上的 MySQL 每 30 秒重生一次](https://linux22.com/image/572725/Ubuntu%20%E4%B8%8A%E7%9A%84%20MySQL%20%E6%AF%8F%2030%20%E7%A7%92%E9%87%8D%E7%94%9F%E4%B8%80%E6%AC%A1.png)
因为我不知道在另一个问题中提问是否合适,所以我开了一个新的问题 - 我可能遇到与这里相同的问题:mysql 服务器每 30 秒重启一次
但是:我的 MaSQL 没有记录配置错误(事实上,我认为配置中确实出了问题,因为他根本没有记录。但他启动了(我可以连接/使用它),但服务器变得非常慢,过了一段时间,他不再响应,必须进行硬重置。
有人能帮我检查一下配置文件吗?我会把它放在下面——不过知道了:这是一个多实例设置。至少实例 2 有这个问题
这是 Ubuntu 10.10,MySQL 5.1。我的 Syslog 如下所示:
Jan 16 10:03:06 testing2 init: mysql main process (22245) terminated with status 1
Jan 16 10:03:06 testing2 init: mysql main process ended, respawning
Jan 16 10:03:37 testing2 init: mysql post-start process (22246) terminated with status 1
Jan 16 10:03:37 testing2 init: mysql main process (22314) terminated with status 1
Jan 16 10:03:37 testing2 init: mysql main process ended, respawning
Jan 16 10:04:07 testing2 init: mysql post-start process (22315) terminated with status 1
Jan 16 10:04:08 testing2 init: mysql main process (22383) terminated with status 1
Jan 16 10:04:08 testing2 init: mysql main process ended, respawning
Jan 16 10:04:38 testing2 init: mysql post-start process (22384) terminated with status 1
Jan 16 10:04:39 testing2 init: mysql main process (22452) terminated with status 1
Jan 16 10:04:39 testing2 init: mysql main process ended, respawning
Jan 16 10:05:01 testing2 CRON[22519]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jan 16 10:05:09 testing2 init: mysql post-start process (22453) terminated with status 1
Jan 16 10:05:09 testing2 init: mysql main process (22540) terminated with status 1
Jan 16 10:05:09 testing2 init: mysql main process ended, respawning
会议:
[mysqld_multi]
mysqld = /usr/sbin/mysqld
mysqladmin = /usr/bin/mysqladmin
user = debian-sys-maint
password = iYOO9xwrplvgTG5D
[mysqld1]
user = mysql
pid-file = /export/dat/mysql/mysqld1/mysqld.pid
socket = /export/dat/mysql/mysqld1/mysqld.sock
port = 3307
basedir = /usr
datadir = /export/dat/mysql/mysqld1/data
#tmpdir = /tmp/mysqld1
tmpdir = /export1/mysqltmp/mysqld1
language = /usr/share/mysql/english
log = /var/log/mysql/mysql1.log
log-error = /var/log/mysql/mysql1.error
skip-external-locking
key_buffer = 16M
max_allowed_packet = 64M
thread_stack = 128K
thread_cache_size = 8
query_cache_limit = 1M
query_cache_size = 256M
expire_logs_days = 10
max_binlog_size = 100M
character_set_server =utf8
default-character-set =utf8
innodb_buffer_pool_size =700M
innodb_additional_mem_pool_size=10M
innodb_log_file_size =100M
innodb_log_buffer_size =4M
innodb_flush_log_at_trx_commit=0
innodb_data_home_dir =/export/dat/mysql/mysqld1/innodbfiles
innodb_file_per_table
lower_case_table_names=1
table_cache=512
tmp_table_size=18M
innodb_flush_log_at_trx_commit=0
innodb_thread_concurrency=8
# Log slow queries, time threshold set by 'long_query_time',
#log_slow_queries = /var/log/mysql_query.log
#log_output = FILE # 5.1 only
#long_query_time = 5
ignore_builtin_innodb
plugin-load=innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so;innodb_locks=ha_innodb_plugin.so;innodb_lock_waits=ha_innodb_plugin.so;innodb_cmp=ha_innodb_plugin.so;innodb_cmp_reset=ha_innodb_plugin.so;innodb_cmpmem=ha_innodb_plugin.so;innodb_cmpmem_reset=ha_innodb_plugin.so
default-storage-engine=InnoDB
innodb_file_per_table=1
innodb_file_format=barracuda
innodb_strict_mode=1
[mysqld2]
user = mysql
pid-file = /export/dat/mysql/mysqld2/mysqld.pid
socket = /export/dat/mysql/mysqld2/mysqld.sock
port = 3306
basedir = /usr
datadir = /export/dat/mysql/mysqld2/data
#tmpdir = /tmp/mysqld2
tmpdir = /export1/mysqltmp/mysqld2
language = /usr/share/mysql/english
log = /var/log/mysql/mysql2.log
log-error = /var/log/mysql/mysql2.error
skip-external-locking
key_buffer = 16M
max_allowed_packet = 64M
thread_stack = 128K
thread_cache_size = 8
query_cache_limit = 1M
query_cache_size = 256M
expire_logs_days = 10
max_binlog_size = 100M
character_set_server =utf8
default-character-set =utf8
innodb_buffer_pool_size =700M
innodb_additional_mem_pool_size=10M
innodb_log_file_size =100M
innodb_log_buffer_size =4M
innodb_flush_log_at_trx_commit=0
loose_innodb_data_home_dir =/export/dat/mysql/mysqld2/innodbfiles
#innodb_file_per_table
lower_case_table_names=1
table_cache=512
tmp_table_size=18M
innodb_flush_log_at_trx_commit=0
innodb_thread_concurrency=8
# Log slow queries, time threshold set by 'long_query_time',
#log_slow_queries = /var/log/mysql_query.log
#log_output = FILE # 5.1 only
#long_query_time = 3
ignore_builtin_innodb
plugin-load=innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so;innodb_locks=ha_innodb_plugin.so;innodb_lock_waits=ha_innodb_plugin.so;innodb_cmp=ha_innodb_plugin.so;innodb_cmp_reset=ha_innodb_plugin.so;innodb_cmpmem=ha_innodb_plugin.so;innodb_cmpmem_reset=ha_innodb_plugin.so
default-storage-engine=InnoDB
innodb_file_per_table=1
innodb_file_format=barracuda
innodb_strict_mode=1
谢谢
答案1
看来我找到原因了……
这是软件包的初始化脚本。由于我将默认设置更改为多设置,因此我使用自己的脚本来停止和启动这两个实例。但看起来软件包更新激活了默认的初始化脚本,而该脚本不适用于我的设置。所以我再次将其停用:
service mysql stop
update-rc.d -f mysql remove
从那时起,系统日志就不再充满重生消息了。现在我继续寻找没有记录任何内容的原因 ;-)
无论如何,感谢您的帮助!
答案2
在我的系统上(10.10 运行 mysqld_multi),/etc/init/ 下有一个 mysql.conf 脚本,我必须删除它才能解决错误。不太清楚它是如何/为什么会出现在那里的,但它确实在执行相同的重生