我正在配置 MySQL 以将其数据存储在 Amazon EBS 卷上。我已将卷安装在/data
,将配置和数据文件移动到卷中,并对 MySQL 文件进行符号链接:
ln -s /data/mysql/lib/mysql /var/lib/mysql
ln -s /data/mysql/etc/mysql/my.cnf /etc/mysql/my.cnf
ln -s /data/mysql/log/mysqld.log /var/log/mysqld.log
数据库服务器运行但在几个小时后崩溃并出现以下错误:
130316 9:59:04 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
130316 9:59:04 InnoDB: Operating system error number 40 in a file operation.
InnoDB: Error number 40 means 'Too many levels of symbolic links'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File name ./ln
InnoDB: File operation call: 'stat'.
InnoDB: Error: os_file_readdir_next_file() returned -1 in
InnoDB: directory .
InnoDB: Crash recovery may have failed for some .ibd files!
有人理解这个错误以及如何解决它吗?我试图了解更多信息,但没有太多文档。我正在运行一个 Ubuntu AMI(微型)。
这是我格式化和安装卷(8 GB)的方式:
sudo mkfs.ext4 /dev/xvdf
mkdir -m 000 /data
echo "/dev/xvdf /data auto noatime 0 0" | sudo tee -a /etc/fstab
sudo mount /data