VPS经常因为Mysql,apahce 2G内存满而导致Mysql经常挂~~
经常出现Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)这个问题 ~~
每次都需要手动service mysql restart 重启。。但问题隔两天三后又出现……甚是烦人~
装了Supervisor 监控,手动Kill all mysql 可以自动启动进程 ,但当上面的问题出现后,确无法自动启动?这么坑爹的问题,折腾了我好久好久~~~
mysql 错误日志~~
150201 1:37:09 InnoDB: The InnoDB memory heap is disabled
150201 1:37:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150201 1:37:09 InnoDB: Compressed tables use zlib 1.2.7
150201 1:37:09 InnoDB: Using Linux native AIO
150201 1:37:09 InnoDB: Initializing buffer pool, size = 512.0M
150201 1:37:09 InnoDB: Completed initialization of buffer pool
150201 1:37:09 InnoDB: highest supported file format is Barracuda.
150201 1:37:09 InnoDB: Waiting for the background threads to start
150201 1:37:10 InnoDB: 5.5.41 started; log sequence number 1672214
150201 1:37:10 [ERROR] /usr/sbin/mysqld: unknown variable 'defaults-file=/etc/mysql/my.cnf'
150201 1:37:10 [ERROR] Aborting
150201 1:37:10 InnoDB: Starting shutdown...
150201 1:37:11 InnoDB: Shutdown completed; log sequence number 1672214
150201 1:37:11 [Note] /usr/sbin/mysqld: Shutdown complete
Supervisor 输出定向日志:
150127 18:48:02 InnoDB: The InnoDB memory heap is disabled
150127 18:48:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150127 18:48:02 InnoDB: Compressed tables use zlib 1.2.7
150127 18:48:02 InnoDB: Using Linux native AIO
150127 18:48:02 InnoDB: Initializing buffer pool, size = 512.0M
150127 18:48:02 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
150127 18:48:02 InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
都是这个信息。。足足有80多万条这个信息。。想死的心都有了~~~
supervisord.conf 配置信息这样写的~~
[program:mysqld]
;/bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/dedi-us1.agenciawebsul.com.br.pid
command=/usr/sbin/mysqld /var/run/mysqld/mysqld.pid /var/run/mysqld/mysqld.sock --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 2>&1 > /dev/null &
user=mysql
priority=1
numprocs=1
startsecs=10
startretries=20
autostart=true
autorestart=true
redirect_stderr=false
stdout_logfile=/var/log/supervisor/run.log
stderr_logfile=/var/log/supervisor/error.log
请高手,帮忙解决。。不剩感激~~~
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.