I have an AWS ECS Cluster that uses EC2. I have the following configuration:
- One MariaDB service running on an ECS Cluster
- I am allowing ICMP and DNS (TCP and UDP) in Network ACL and all traffic inside the Security Group
- Service Discovery namespace is namespace_name.local and name is service_name. I am allowing MariaDB 3306 TCP port in the Service Discovery
Now, when I SSH into the EC2 and try to run ping service_name.namespace_name.local I am getting following error:
$ ping service_name.namespace_name.localping: service_name.namespace_name.local: Name or service not known
One thing to note that, MariaDB container is up and running. I can access it via docker -exec -it CONTAINER_ID sh
command and the logs shows no errors related to this.
So, I need to access the hostname of MariaDB container from it's host EC2 instance but am unable to do it. What is the rootcause behind this problem?