Are you able to monitor clients using the pmm-client (vs the remote monitoring)?
No, because the client is not available for the OS on which the MySQL server is running.
Can your docker host ping the server in question?
Yes, as I indicated in my original post I could ping the server from the docker host (CentOS) and from inside the container. Here are the two examples:
[root@centos ~]# ping -c 1 192.168.0.1<br>PING 192.168.79.5 (192.168.0.1) 56(84) bytes of data.<br>64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.156 ms<br><br>--- 192.168.0.1 ping statistics ---<br>1 packets transmitted, 1 received, 0% packet loss, time 0ms<br>rtt min/avg/max/mdev = 0.156/0.156/0.156/0.000 ms
[root@42ebccdb24c6 opt]# ping -c 1 192.168.0.1<br>PING 192.168.79.5 (192.168.0.1) 56(84) bytes of data.<br>64 bytes from 192.168.0.1: icmp_seq=1 ttl=63 time=0.234 ms<br><br>--- 192.168.0.1 ping statistics ---<br>1 packets transmitted, 1 received, 0% packet loss, time 0ms<br>rtt min/avg/max/mdev = 0.234/0.234/0.234/0.000 ms
If you can ping the server can the docker host telnet to that server on port 3306 (telnet <servername> 3306)? If no to either (or both) I'm wondering if there's a firewall in the way or possibly mysql's not listening to a port but instead bound to a socket.
Yes, as I indicated in one of my follow ups "
I ensured that the user/password work from the same host where the container runs". Here's an example:
[root@centos ~]# mysql -h 192.168.0.1 -u pmm -p<br>Enter password:<br>Welcome to the MySQL monitor. Commands end with ; or \g.<br>Your MySQL connection id is 507073<br>Server version: 5.7.30-log Source distribution<br><br>Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.<br><br>Oracle is a registered trademark of Oracle Corporation and/or its<br>affiliates. Other names may be trademarks of their respective<br>owners.<br><br>Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br>mysql><br>
And with telnet:
[root@centos ~]# telnet 192.168.0.1 3306<br>Trying 192.168.0.1...<br>Connected to 192.168.0.1.<br>Escape character is '^]'.<br>N<br>5.7.30-log▒m?r_6▒▒Jic?gUJea(^mysql_native_password^CConnection closed by foreign host.
I cannot try the same from the container, because neither command mysql nor telnet is available.
<code>[root@42ebccdb24c6 opt]# mysql<br>bash: mysql: command not found<br>[root@42ebccdb24c6 opt]# telnet<br>bash: telnet: command not found<br></code>
There is no firewall and both the docker host and the MySQL server are in the same network segment. The MySQL server is well listening on the network port as confirmed above.
I'm confused by the "no route to host" which typically says the pmm server either doesn't have a network connection OR the routing tables are messed up and trying to get to the 192.168.0.x network via the wrong interface (maybe check to make sure your subnet masks are correct on both mysql server and docker host?
I'm confused as well, so I decided to start this post :) On the docker host there are the following interfaces:
[root@centos ~]# ifconfig<br>docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500<br> inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255<br> inet6 fe80::42:71ff:fe0d:132c prefixlen 64 scopeid 0x20<link><br> ether 02:42:71:0d:13:2c txqueuelen 0 (Ethernet)<br> RX packets 64520 bytes 44355116 (42.3 MiB)<br> RX errors 0 dropped 0 overruns 0 frame 0<br> TX packets 51299 bytes 5509338 (5.2 MiB)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br><br>ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500<br> inet 192.168.0.1 netmask 255.255.255.128 broadcast 192.168.0.127<br> inet6 fe80::250:56ff:fe03:84 prefixlen 64 scopeid 0x20<link><br> inet6 2001:470:7038:1979:250:56ff:fe03:84 prefixlen 64 scopeid 0x0<global><br> ether 00:50:56:03:00:84 txqueuelen 1000 (Ethernet)<br> RX packets 2127919 bytes 360648671 (343.9 MiB)<br> RX errors 0 dropped 1 overruns 0 frame 0<br> TX packets 704897 bytes 120451110 (114.8 MiB)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br><br>lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536<br> inet 127.0.0.1 netmask 255.0.0.0<br> inet6 ::1 prefixlen 128 scopeid 0x10<host><br> loop txqueuelen 1000 (Local Loopback)<br> RX packets 0 bytes 0 (0.0 B)<br> RX errors 0 dropped 0 overruns 0 frame 0<br> TX packets 0 bytes 0 (0.0 B)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br><br>veth5dc95c9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500<br> inet6 fe80::946a:aeff:febd:79 prefixlen 64 scopeid 0x20<link><br> ether 96:6a:ae:bd:00:79 txqueuelen 0 (Ethernet)<br> RX packets 64520 bytes 45258396 (43.1 MiB)<br> RX errors 0 dropped 0 overruns 0 frame 0<br> TX packets 51619 bytes 5532818 (5.2 MiB)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br><br>virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500<br> inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255<br> ether 52:54:00:e2:e4:25 txqueuelen 1000 (Ethernet)<br> RX packets 0 bytes 0 (0.0 B)<br> RX errors 0 dropped 0 overruns 0 frame 0<br> TX packets 0 bytes 0 (0.0 B)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
And on the MySQL server host:
root@sotirov:~# ifconfig<br>eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500<br> inet 192.168.0.1 netmask 255.255.255.128 broadcast 192.168.0.127<br> inet6 2001:470:7038:1979:c6ca:6bb0:3f8c:2f5 prefixlen 64 scopeid 0x0<global><br> inet6 fe80::9eb6:20c:f215:9576 prefixlen 64 scopeid 0x20<link><br> ether d8:50:e6:4b:e4:78 txqueuelen 1000 (Ethernet)<br> RX packets 322041226 bytes 209841554320 (195.4 GiB)<br> RX errors 0 dropped 17 overruns 0 frame 0<br> TX packets 755094716 bytes 1054750639701 (982.3 GiB)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br><br>lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536<br> inet 127.0.0.1 netmask 255.0.0.0<br> inet6 ::1 prefixlen 128 scopeid 0x10<host><br> loop txqueuelen 1 (Local Loopback)<br> RX packets 170692305 bytes 40904383500 (38.0 GiB)<br> RX errors 0 dropped 0 overruns 0 frame 0<br> TX packets 170692305 bytes 40904383500 (38.0 GiB)<br> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I do not think the problem are the network masks, because the MySQL server is well accessible from anywhere on my network.