1

I have two servers in one network.

  1. 192.168.202.5 netmask 255.255.255.0
  2. 192.168.202.32 netmask 255.255.255.0

On second server I start MySQL using Docker Compose.

docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                   PORTS                                                   NAMES
dec33e6c66fe        mysql/mysql-cluster   "/entrypoint.sh mysq…"   2 hours ago         Up 2 hours (healthy)     1186/tcp, 2202/tcp, 33060/tcp, 0.0.0.0:3306->3306/tcp   ndb_ndb_mysqld_1
56ccfd399288        mysql/mysql-cluster   "/entrypoint.sh ndbd"    2 hours ago         Up 2 hours (unhealthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                 ndb_ndb_data_node_1_1
1f6a2f2db72c        mysql/mysql-cluster   "/entrypoint.sh ndb_…"   2 hours ago         Up 2 hours (unhealthy)   2202/tcp, 3306/tcp, 0.0.0.0:1186->1186/tcp, 33060/tcp   ndb_ndb_mgmd_1

netstat -nta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 192.168.202.32:22       10.40.20.156:34458      ESTABLISHED
tcp        0     36 192.168.202.32:22       10.40.20.156:35210      ESTABLISHED
tcp6       0      0 :::3306                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::1186                 :::*                    LISTEN

Port 3306 open. On second server (192.168.202.32) I try:

telnet 192.168.202.32 3306
Trying 192.168.202.32...
Connected to 192.168.202.32.
Escape character is '^]'.
`
5.7.25-ndb-7.6.9-cluster-gpl

Access is and everything is available.

But when I try to do the same from the first server (from 192.168.202.5), I get connection timeout:

telnet 192.168.202.32 3306
Trying 192.168.202.32...
telnet: connect to address 192.168.202.32: Connection timed out
[oracle@host-192-168-202-5 ~]$ 

But at the same time on port 22 I can connect. I tried disabling Iptables, but it didn't help. I can not understand why this is happening and where to look for more information?

I use OracleLinux7.

uname -a
Linux host-192-168-202-5 3.8.13-118.6.1.el7uek.x86_64
  • I don't have a lot of docker knowledge, but it's been my experience that you cannot normally make a connection from docker A to docker B using the external docker IPs. Each docker container should also be running within the docker network and those IPs should allow for intra-container communication. Otherwise, you'd have to create a new docker network and launch both containers inside that network to have docker-docker communication available. – utdrmac Jul 16 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.