Bug #104868 Remote Access of Mysql Cluster Docker issue
Submitted: 8 Sep 2021 11:13 Modified: 9 Sep 2021 12:41
Reporter: Ambar Adhikari Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Docker Image Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[8 Sep 2021 11:13] Ambar Adhikari
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"
[9 Sep 2021 12:41] MySQL Verification Team
Hi,

I'm sorry but I don't see how is this a bug. Your own ndb_mgm show shows that cluster is running. 

This is a bug report system, not a support ticketing system. We will be happy to support you if you contact our MySQL Support team or you can use a community support on https://forums.mysql.com/ 

If the manual on the docker site is incomplete please let them know how they could improve it

Thanks