MySQL-Cluster 启动失败 [英] MySQL-Cluster fails to start
问题描述
这不是我第一次创建 ndb 集群,但我没有遇到过这样的问题.
This is not my first time creating an ndb cluster but I hadn't received such a problem.
I am following this manual by team mysql.
我使用默认配置回显 在这GitHub 存储库.
I am using the default configuration echoed in this GitHub repository.
当我启动 ndb_mgmd 容器时,它返回以下错误:
When I start my ndb_mgmd container, it returns the following error:
$ docker run -d --net=cluster --name=management1 --ip=192.168.0.2 mysql/mysql-cluster ndb_mgmd
我收到的日志是:
$ docker logs management1
它返回以下几行
[Entrypoint] MySQL Docker Image 8.0.24-1.2.2-cluster
[Entrypoint] Starting ndb_mgmd
Failed to open /sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list: No such file or directory
ndb_mgmd: [ERROR] unknown variable 'user='.
MySQL Cluster Management Server mysql-8.0.24 ndb-8.0.24
并且容器立即退出.我不确定它是否是一个错误,因此我用 SO 写了它.
and the container exits immediately. I am not sure if it is a bug, thus I write it in SO.
推荐答案
这是一个错误.
我运行普通的 echo 并且 --user= 被 docker 图像附加到命令行.
I run plain echo and --user= is appended to the commandline by docker image.
$ docker run -d --net=cluster --name=management1 --ip=192.168.0.2 mysql/mysql-cluster echo
55b11ea72989fad50b29fe199ad54ebe2a919079770d0188512a465699e8a256
$ docker logs management1
[Entrypoint] MySQL Docker Image 8.0.24-1.2.2-cluster
--user=
可能有一些解决方法可以启动 MySQL 服务器,但不适用于 Ndb 程序.
Probably some workaround that works starting the MySQL server, but not suitable for Ndb programs.
编辑#1:
在新的 docker 镜像修复完成之前,您可以尝试以下解决方法.
Until new docker images are fixed and out you can try the below workaround.
它会在使用 --entrypoint=/usr/bin/env
启动 ndb 进程时覆盖错误的入口点脚本(注意,必须在图像 mysql/mysql-cluster
之前>).
It overrides the faulty entrypoint script when starting the ndb processes with --entrypoint=/usr/bin/env
(note, must be before image mysql/mysql-cluster
).
并使用从入口点脚本中提取的显式命令行选项 https://github.com/mysql/mysql-docker/blob/main/mysql-cluster/8.0/docker-entrypoint.sh .
And using explicit command line options extracted from entrypoint script at https://github.com/mysql/mysql-docker/blob/main/mysql-cluster/8.0/docker-entrypoint.sh .
对于管理服务器覆盖入口点并添加-f/etc/mysql-cluster.cnf --nodaemon
:
For management server override entrypoint and add -f /etc/mysql-cluster.cnf --nodaemon
:
$ docker run -d --net=cluster --name=management1 --ip=192.168.0.2 --entrypoint=/usr/bin/env mysql/mysql-cluster ndb_mgmd -f /etc/mysql-cluster.cnf --nodaemon
两个数据节点(我选择ndbmtd
而不是ndbd
)覆盖入口点并添加--nodaemon
:
The two data nodes (I choose ndbmtd
instead of ndbd
) override entrypoint and add --nodaemon
:
$ docker run -d --net=cluster --name=ndb1 --ip=192.168.0.3 --entrypoint=/usr/bin/env mysql/mysql-cluster ndbmtd --nodaemon
$ docker run -d --net=cluster --name=ndb2 --ip=192.168.0.4 --entrypoint=/usr/bin/env mysql/mysql-cluster ndbmtd --nodaemon
当启动 mysqld
时,你不应该覆盖入口点,坚持使用手册.
When starting the mysqld
you should not override the entrypoint, stick to the manual.
编辑#2:
mysql-cluster docker 镜像现已修复,拉取新镜像并重新创建容器.
The mysql-cluster docker image is now fixed, pull the new image and recreate containers.
$ docker pull mysql/mysql-cluster
Using default tag: latest
latest: Pulling from mysql/mysql-cluster
Digest: sha256:a8ae8a4358f0c2f07aa39df046eb81e8f88cb2bebcaaf436c67663b300a1e1fe
Status: Image is up to date for mysql/mysql-cluster:latest
docker.io/mysql/mysql-cluster:latest
$ docker run -d --net=cluster --name=management1 --ip=192.168.0.2 mysql/mysql-cluster ndb_mgmd
715ad773b51b3d8fefcf6230460b6149a0a0226ee604752352b9e88d8dfa5bb8
$ docker logs management1
[Entrypoint] MySQL Docker Image 8.0.25-1.2.3-cluster
[Entrypoint] Starting ndb_mgmd
MySQL Cluster Management Server mysql-8.0.25 ndb-8.0.25
2021-05-12 07:59:21 [MgmtSrvr] INFO -- The default config directory '/usr/mysql-cluster' does not exist. Trying to create it...
2021-05-12 07:59:21 [MgmtSrvr] INFO -- Sucessfully created config directory
2021-05-12 07:59:21 [MgmtSrvr] WARNING -- at line 19: [DB] IndexMemory is deprecated, will use Number bytes on each ndbd(DB) node allocated for storing indexes instead
2021-05-12 07:59:21 [MgmtSrvr] INFO -- Got initial configuration from '/etc/mysql-cluster.cnf', will try to set it when all
ndb_mgmd(s) started
2021-05-12 07:59:21 [MgmtSrvr] INFO -- Node 1: Node 1 Connected
2021-05-12 07:59:21 [MgmtSrvr] INFO -- Id: 1, Command port: *:1186
==INITIAL==
2021-05-12 07:59:21 [MgmtSrvr] INFO -- MySQL Cluster Management Server mysql-8.0.25 ndb-8.0.25 started
2021-05-12 07:59:22 [MgmtSrvr] INFO -- Node 1 connected
2021-05-12 07:59:22 [MgmtSrvr] INFO -- Starting initial configuration change
2021-05-12 07:59:22 [MgmtSrvr] INFO -- Configuration 1 commited
2021-05-12 07:59:22 [MgmtSrvr] INFO -- Config change completed! New generation: 1
==CONFIRMED==
这篇关于MySQL-Cluster 启动失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!