Description:
this is the docker "CLUSTER" of mysql running.. i followed this link to create mysql cluster docker in an remote server (AWS EC2 instance)..
https://hub.docker.com/r/mysql/mysql-cluster/
and its initialised as you can check from the logs below and can access from mysql nodes from the localhost.. But i am not able to remote access from other server or from MySQLWorkBench Tool..
I am not able to set the Port 3306 in all nodes of Mysql docker cluster..
How to proceed from here??
Note:- when i run a Mysql Docker image( not a cluster).. then its working fine and i am able to remote access.. as i was able to set port 3306..
////////////////////////////////////////////////////
ubuntu@ip-172-31-28-22:~$
ubuntu@ip-172-31-28-22:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9cddc3e91e5 mysql/mysql-cluster "/entrypoint.sh mysq…" 24 minutes ago Up 24 minutes (healthy) 1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp mysql2
de76008b349f mysql/mysql-cluster "/entrypoint.sh mysq…" 24 minutes ago Up 24 minutes (healthy) 1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp mysql1
61929960d349 mysql/mysql-cluster "/entrypoint.sh ndbd" 57 minutes ago Up 57 minutes (unhealthy) 1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp ndb1
8fba07a9fcf0 mysql/mysql-cluster "/entrypoint.sh ndbd" 58 minutes ago Up 58 minutes (unhealthy) 1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp ndb2
c82559b86a2e mysql/mysql-cluster "/entrypoint.sh ndb_…" 58 minutes ago Up 58 minutes (unhealthy) 1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp management1
ubuntu@ip-172-31-28-22:~$
ubuntu@ip-172-31-28-22:~$
ubuntu@ip-172-31-28-22:~$
ubuntu@ip-172-31-28-22:~$
ubuntu@ip-172-31-28-22:~$ sudo docker run -it --net=cluster mysql/mysql-cluster ndb_mgm
[Entrypoint] MySQL Docker Image 7.6.19-1.2.4-cluster
[Entrypoint] Starting ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 192.168.0.2:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.0.3 (mysql-5.7.35 ndb-7.6.19, Nodegroup: 0, *)
id=3 @192.168.0.4 (mysql-5.7.35 ndb-7.6.19, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.0.2 (mysql-5.7.35 ndb-7.6.19)
[mysqld(API)] 2 node(s)
id=4 @192.168.0.10 (mysql-5.7.35 ndb-7.6.19)
id=5 @192.168.0.9 (mysql-5.7.35 ndb-7.6.19)
ndb_mgm>
ndb_mgm>
ndb_mgm> exit
ubuntu@ip-172-31-28-22:~$
ubuntu@ip-172-31-28-22:~$
////////////////////////////////////////////////////
How to repeat:
after setting the MySQL Cluster by following the steps in
https://hub.docker.com/r/mysql/mysql-cluster/
try to remote access the mysql cluster using MySQLWorkBench tool we get the below error:-
"Unable to connect to localhost"