HTTP Call to Docker Container redirects IP to Docker ID HTTP Call to Docker Container redirects IP to Docker ID docker docker

HTTP Call to Docker Container redirects IP to Docker ID


After hours and hours of digging around, I finally fixed the issue. Maybe this is obvious to some people, but hopefully I can help noobs like me by posting my solution.

When I first ran my docker, I didn't specify a hostname to use for my container, so it was assigned a random default value which in this case was 453af3bd9164. However, this causes DNS lookup issues and you need to make sure your Docker container's host computer name and the docker container's name are the same. So I added this flag:

docker run -h "computer-name@example.com"

I also added this property to my hdfs-site.xml:

<property>    <name>dfs.namenode.datanode.registration.ip-hostname-check</name>    <value>false</false></property>

Doing these 2 things allowed me to read/write to my datanodes.