The mysql/mysql-cluster didn't have ARM version. So I build one.
10K+
The existing mysql/mysql-cluster only support X86 64bit and no ARM version. So i build my own.
https://github.com/WindoC/mysql-cluster
forked from mysql/mysql-docker
Most of the setting should be same.
docker build -t mysql-cluster:8 .
https://hub.docker.com/repository/docker/windoac/mysql-cluster
docker pull windoac/mysql-cluster:8
suppose request you have maximum 5 servers or minimum 3 servers.
--add-host list.for example, ip 192.168.0.21 ~ 25 use for the cluster
addhosts=$(cat << EOF
--add-host ndbmgm:192.168.0.21
--add-host ndb1:192.168.0.22
--add-host ndb2:192.168.0.23
--add-host mysql1:192.168.0.24
--add-host mysql2:192.168.0.25
EOF
)
image=mysql-cluster:8
or
image=windoac/bind-webmin:mysql-cluster:8
Base on the mysql-cluster node role you prepare to start/run
therole=ndb_mgmd
therole=ndbd
therole=mysqld
the data and config you would like to store. Can you current path or some others.
# current path
datapath=$(pwd)
# or some others ex: /data
datapath=/data
roledatapath=$datapath/$therole
mkdir -p $roledatapath/config
mkdir -p $roledatapath/data
(Use sudo, chown and chmod if need)
curl https://raw.githubusercontent.com/WindoC/mysql-cluster/main/cnf/my.cnf -o $roledatapath/config/my.cnf
curl https://raw.githubusercontent.com/WindoC/mysql-cluster/main/cnf/mysql-cluster.cnf -o $roledatapath/config/mysql-cluster.cnf
Add them for your need.
configvolumes=$(cat << EOF
-v $roledatapath/config/my.cnf:/etc/my.cnf
-v $roledatapath/config/mysql-cluster.cnf:/etc/mysql-cluster.cnf
EOF
)
datavolumes="-v $roledatapath/data:/data"
####8. start/run the container
docker run -d --name ndbmgm --net host $addhosts $configvolumes $datavolumes $image $therole
docker run -d --name ndb1 --net host $addhosts $configvolumes $datavolumes $image $therole
docker run -d --name ndb2 --net host $addhosts $configvolumes $datavolumes $image $therole
docker run -d --name mysql1 --net host $addhosts $configvolumes $datavolumes $image $therole
docker run -d --name mysql2 --net host $addhosts $configvolumes $datavolumes $image $therole
Content type
Image
Digest
sha256:752907355…
Size
187.7 MB
Last updated
over 2 years ago
docker pull windoac/mysql-cluster