Support Questions
Find answers, ask questions, and share your expertise

Enable port 6667 for external access started on vmware that contains docker inside

Enable port 6667 for external access started on vmware that contains docker inside

New Contributor

Hi,

I am using the HDP image version 2.6 imported on VMWARE and this image contains inside the docker, but the port 6667 is not configured for access via external IP of my VMWARE. I would like to access the KAFKA broker via external IP for test, because I am using the Kafka Tools. I changed the IP of broker to access the connection for IP 0.0.0.0, please see the netstat command on the docker.

[root@sandbox ~]# netstat -an | more Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 172.17.0.2:16000 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:10016 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8032 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:6080 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:18081 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:10020 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:6085 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:2181 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8999 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:4200 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:4040 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8040 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:39593 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:7337 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:41673 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:16010 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8042 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8010 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:6667 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:9995 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8141 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:45454 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:19888 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:10033 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:4242 0.0.0.0:* LISTEN

Docker is using IP 172.17.0.2. When I try to access the port directly on the VM via telnet is connecting normally, but outside of the VM no.

I tried to enable the TCP port via cmdlline below and I am getting the error

[root@sandbox-host ~]# docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6667 -container-ip 172.17.0.2 -container-port 6667 2017/07/04 20:31:38 Stopping proxy on tcp/[::]:6667 for tcp/172.17.0.2:6667 (accept tcp [::]:6667: accept4: bad file descriptor)

Is there any that have this problem and find the solution? I tried to change the file config.v2.json and hostconfig.json and included the port 6667, but the problem persist.

Regards,

1 REPLY 1
Highlighted

Re: Enable port 6667 for external access started on vmware that contains docker inside

Expert Contributor

The approach you're taking of opening a port on the live docker instance will be difficult - it's better to create a new docker image with the port passthrough.

To do this:

  • In the host HDP VM, you'll find a folder called start_scripts inside of /root. Inside of that there is a file called start_sandbox.sh which defines the docker container and starts it. You'll need to edit this file.
  • You'll see a bunch of IP's being mapped from host to child. Add your IP here, in this case
-p 6667:6667 \
  • Run the following to delete the existing sandbox docker image:
docker container stop sandbox

docker container rm sandbox
  • Restart your instance
  • You should now be able to communicate to the child's port 6667 from your host HDP VM.

Keep in mind this will delete your child docker instance. Either back up any data you need from it or use a different docker instance name (e.g. sandbox2) in the start_sandbox.sh script.

Don't have an account?