0

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.

I am using the default configuration echoed in this GitHub repository.

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

The log I receive is:

$ docker logs management1

It returns the following lines

[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

and the container exits immediately. I am not sure if it is a bug, thus I write it in SO.

Davood Falahati
  • 1,474
  • 16
  • 34

2 Answers2

1

It is a bug.

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=

Probably some workaround that works starting the MySQL server, but not suitable for Ndb programs.

Edit#1:

Until new docker images are fixed and out you can try the below workaround.

It overrides the faulty entrypoint script when starting the ndb processes with --entrypoint=/usr/bin/env (note, must be before image mysql/mysql-cluster).

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 .

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

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

When starting the mysqld you should not override the entrypoint, stick to the manual.

Edit#2:

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==
0

This proved to be a bug. Until being fixed, one can do the following:

1- Clone the mysql-docker

git clone https://github.com/mysql/mysql-docker.git

2- Checkout an earlier tag (1.1.19-cluster checked and verified)

git checkout 1.1.19-cluster

3- build the image and use it later.

docker build -t mysql-cluster-customized 8.0/

4- run management cluster

docker run -d --net=cluster --name=management1 --ip=192.168.0.2 -it  mysql-cluster-customized ndb_mgmd

I hope it helps while mysql team is fixing the issue with the repository head.

Davood Falahati
  • 1,474
  • 16
  • 34