Mysql 经常挂:InnoDB: Unable to lock ./ibdata1, error: 11

jobin5522 2015-01-25 01:08:45
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
——————————————————————————————————————————
...全文
3172 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
HNO3 2015-02-09
  • 打赏
  • 举报
回复
你的QQ是多少,我也遇到这样的问题,想请教下你
jobin5522 2015-01-27
  • 打赏
  • 举报
回复
引用 4 楼 ACMAIN_CHM 的回复:
是不是有什么磁盘备份进程?导致了文件被其它进程锁定。
我装的是vestacp 面板~~会自动备份数据库~~ 今早起来,又是挂了。~出现:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 检查了一下my.cnf,配置文件都对~ [client] port=3306 socket=/var/run/mysqld/mysqld.sock [mysqld_safe] socket=/var/run/mysqld/mysqld.sock [mysqld] user=mysql pid-file=/var/run/mysqld/mysqld.pid socket=/var/run/mysqld/mysqld.sock 郁闷了。。~~
ACMAIN_CHM 2015-01-26
  • 打赏
  • 举报
回复
是不是有什么磁盘备份进程?导致了文件被其它进程锁定。
jobin5522 2015-01-26
  • 打赏
  • 举报
回复
引用 1 楼 rucypli 的回复:
1 半夜是否有什么计划任务 2 ulimit -a是否足够大
除了~~大量的这个外~~ 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. 还有这个错误日志~~ 150125 5:10:18 InnoDB: The InnoDB memory heap is disabled 150125 5:10:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins 150125 5:10:18 InnoDB: Compressed tables use zlib 1.2.7 150125 5:10:18 InnoDB: Using Linux native AIO 150125 5:10:18 InnoDB: Initializing buffer pool, size = 512.0M 150125 5:10:18 InnoDB: Completed initialization of buffer pool 150125 5:10:18 InnoDB: highest supported file format is Barracuda. 150125 5:10:19 InnoDB: Waiting for the background threads to start 150125 5:10:20 InnoDB: 5.5.40 started; log sequence number 1672204 150125 5:10:20 [ERROR] /usr/sbin/mysqld: unknown variable 'defaults-file=/etc/mysql/my.cnf' 150125 5:10:20 [ERROR] Aborting
jobin5522 2015-01-26
  • 打赏
  • 举报
回复
回版主大大,半夜没有什么任务的~~ 守护进程无法启动,一直返回以上的错误~~~ 我只能是手动service mysql restart 这样才正常~~ ulimit -a 出现以下信息,不知道如何算大~~程序是PHP的~~不太懂! core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 7970 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 7970 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
rucypli 2015-01-25
  • 打赏
  • 举报
回复
1 半夜是否有什么计划任务 2 ulimit -a是否足够大

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧