gpt4 book ai didi

mysql - 在 Lustre 文件系统上启动 Mysqld 的持续时间太长(InnoDB : Unable to lock ./ibdata1,错误:38)

转载 作者:太空宇宙 更新时间:2023-11-04 11:02:06 25 4
gpt4 key购买 nike

我可以启动mysqld并正常使用了。但是启动时间很长(超过3分钟)。当我检查日志文件 ( /var/log/mysqld.log ) 时,我发现 InnoDB: Unable to lock ./ibdata1, error: 38 .

最近,我从/var/lib/mysql 移动了我的mysql 数据。至 /home/user/mysql因为文件太大。然后我改了datadir/etc/my.cnf/etc/init.d/mysqld分别改datasocketc/my.cnf . /home/user/mysql 的所有者和 mod并且其中的文件也已正确设置。

/home此安装中的卷位于 Lustre 文件系统上。

当我发现我的数据库中有 3 个 innodb 引擎表时,我将它们删除了。但问题仍然存在。

这是启动 mysqld 时的日志(/var/log/mysqld.log)。

141027 19:40:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
141027 19:40:04 mysqld_safe Starting mysqld daemon with databases from /home/user/mysql
InnoDB: Unable to lock ./ibdata1, error: 38
141027 19:40:04 InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
InnoDB: Unable to lock ./ibdata1, error: 38
141027 19:41:45 InnoDB: Unable to open the first data file
InnoDB: Error in opening ./ibdata1
141027 19:41:45 InnoDB: Operating system error number 38 in a file operation.
InnoDB: Error number 38 means 'Function not implemented'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not InnoDB: remove old data files which contain your precious data!
141027 19:41:45 [ERROR] Plugin 'InnoDB' init function returned error.
141027 19:41:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141027 19:41:45 [Note] Event Scheduler: Loaded 0 events
141027 19:41:45 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.52' socket: '/home/user/mysql/mysql.sock' port: 3306 Source distribution

最佳答案

您正在为您的 /home 卷使用 Lustre 文件系统。除非您专门在 Lustre 卷上启用它,否则该文件系统不支持文件锁定。但是 InnoDB 需要锁定其文件才能正常运行。因此,当 InnoDB 发出 ioctl(2) 调用来锁定文件时,文件系统会返回“Function not implemented”。这就是您的错误日志所说的内容。

InnoDB: Error in opening ./ibdata1
141027 19:41:45 InnoDB: Operating system error number 38 in a file operation.
InnoDB: Error number 38 means 'Function not implemented'.

这是关于这一点的旧列表服务的链接。 http://lists.lustre.org/pipermail/lustre-discuss/2007-August/003768.html在该线程的某处,有人提到了如何启用文件锁定。

您可能希望与管理您的文件系统的人员合作,为您的 MySQL 数据库创建一个特殊用途的 Lustre 卷,一个启用了锁定的卷。

这是一个关键任务 MySQL 服务器吗?如果是这样,请在将其部署到该文件系统之前进行大量尽职调查。

关于mysql - 在 Lustre 文件系统上启动 Mysqld 的持续时间太长(InnoDB : Unable to lock ./ibdata1,错误:38),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26587227/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com