由于 mysql,Rancher Server(Docker 容器)不断重启

Rancher Server (Docker Container) keeps restarting because of mysql

我有一个 Rancher Server 运行 几个月了,在服务器重新启动后它一直在重新启动,因为 mysql 错误:

Rancher 容器日志:

180719 16:51:17 [Note] Plugin 'FEDERATED' is disabled. /usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 180719 16:51:17 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 180719 16:51:17 InnoDB: The InnoDB memory heap is disabled 180719 16:51:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins 180719 16:51:17 InnoDB: Compressed tables use zlib 1.2.8 180719 16:51:17 InnoDB: Using Linux native AIO 180719 16:51:17 InnoDB: Initializing buffer pool, size = 128.0M 180719 16:51:17 InnoDB: Completed initialization of buffer pool 180719 16:51:17 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: File operation call: 'create'. InnoDB: Cannot continue operation.

我在容器或主机中的任何地方都找不到 ibdata1 文件,我们应该如何在不丢失现有 rancher 配置的情况下使用它?

我不确定问题的根本原因,但这里有一些恢复设置的提示:

1a) 从 rancher/server 容器复制数据。这是 link,您可以在其中找到说明:https://rancher.com/docs/rancher/v1.6/en/upgrading/#single-container

1b) 使用复制出的数据量启动相同版本的 rancher,而不是按照说明中指出的进行升级。

2a) 如果现有的容器是运行,你可以从容器里面复制出mysql的数据。

host# mkdir -p mysql_data_recovery && cd mysql_data_recovery
host# docker cp rancher_server_container_id:/var/lib/mysql .

2b) 启动一个新的 rancher/server 并安装此目录。