Connect to mariadb server in docker from external machine
Hey all, I have a mariadb server running in docker and for the life of me I can't figure out how to properly get my 2 external gamemodes (creative and lobby) to connect plugins to the database server without them timing out. It's for sure not a permissions or connectivity issue, because I can connect to them fine intially, but the connection times out after some time. Plugins like luckperms for example will actually time out the player if there are database connectivity issues, making those servers unplayable. If I restart the server, or reload the plugin, it connects just fine.
I've increased the max connections to a super high number, ensured the port is published by docker and permissions are correct. I've also increased the ulimit and made it persistent. Any ideas? For those here with experience running database servers in docker, how did you connect external clients to it without it timing out?
3 Replies
My host has also added an accept rule for port 3306, so I don't think it's a firewall issue either
And yes, port 3306 is fully exposed through my firewall
if your servers are running in docker on the same machine, then you can just use the container's name and docker resolves the dns record
this is probably a good time to use tcpdump to see if traffic is reaching the machine and checking if the data is leaving the machine
no no the servers on the same machine are fine, no issue there. The problem is 2 servers are in a completely different city
TCPdump is a good idea, I'll try that