Mysql 经常挂:InnoDB: Unable to lock ./ibdata1, error: 11
Mysql 经常挂,用了supervisord守护进程,如果手动Kill -9 mysql进程的话,可以自动恢复。其它情况挂的时候,日志却报以上错误~~
supervisord 配置也没有错~~以下是supervisord配置
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=root --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 &
求 高手帮忙解决一下这个问题。。一直老挂~~IP大概1W左右,2G内存~百度了好久。没有找到真正解决的方法~~
以下是错误日志~~~每次都在半夜就挂~~好无语~~
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.
150125 1:52:43 InnoDB: Unable to open the first data file
InnoDB: Error in opening ./ibdata1
150125 1:52:43 InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
150125 1:52:43 InnoDB: Could not open or create data files.
150125 1:52:43 InnoDB: If you tried to add new data files, and it failed here,
150125 1:52:43 InnoDB: you should now edit innodb_data_file_path in my.cnf back
150125 1:52:43 InnoDB: to what it was, and remove the new ibdata files InnoDB created
150125 1:52:43 InnoDB: in this failed attempt. InnoDB only wrote those files full of
150125 1:52:43 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
150125 1:52:43 InnoDB: remove old data files which contain your precious data!
150125 1:52:43 [ERROR] Plugin 'InnoDB' init function returned error.
150125 1:52:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150125 1:52:43 [ERROR] /usr/sbin/mysqld: unknown variable 'defaults-file=/etc/mysql/my.cnf'
150125 1:52:43 [ERROR] Aborting
150125 1:52:43 [Note] /usr/sbin/mysqld: Shutdown complete
150125 1:52:44 InnoDB: The InnoDB memory heap is disabled
150125 1:52:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150125 1:52:44 InnoDB: Compressed tables use zlib 1.2.7
150125 1:52:44 InnoDB: Using Linux native AIO
150125 1:52:44 InnoDB: Initializing buffer pool, size = 512.0M
150125 1:52:44 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.
150125 1:52:44 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
——————————————————————————————————————————