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