Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

CDH quickstart docker port mapping

CDH quickstart docker port mapping

New Contributor

I looked through seemingly related questions but haven't found much of an actual answer yet. I downloaded the CDH quickstart docker and have been trying to deploy it such that the various common Hadoop browser ports are exposed through the localhost browser, namely Hue. The docker runs successfully. I get a prompt inside the docker and can run hadoop and hive from the command line, but http://localhost:7180 and http://localhost:8888 never reach anything. Any help appreciated. Here's what I've tried so far:

docker run --privileged=true --hostname=quickstart.cloudera -p 7180 -p 8888 -t -i 4239cd2958c6 /usr/bin/docker-quickstart

docker run --privileged=true --hostname=quickstart.cloudera -p 7180:7180 -p 8888:8888 -t -i 4239cd2958c6 /usr/bin/docker-quickstart

 

Neither of those worked.  What am I doing wrong?

 

Thanks.

 

EDIT: Hmmm, okay, admittedly, if I use the port that docker is arbitrarily mapping to (32770, 32771, 32772) it works.  So that's good news, but why doesn't the 7180:7180 syntax (shown above) map it through to the same port?  I can see that docker thinks the mapping is working properly, but the browser fails to produce a page at that port.  In fact, doing so breaks the arbitary port (around 32772 and 32773), even though it doesn't map the intended ports (7180, 8888).  So it works if I don't try to remap the ports.  Any idea why?

4 REPLIES 4

Re: CDH quickstart docker port mapping

Rising Star
Sounds like a Docker issue. Are you running Docker on a Linux machine or on something that uses virtualization (e.g. MacOS or Windows)?

Re: CDH quickstart docker port mapping

New Contributor

OS X El Capitan.  Does that mean I need to run the docker using some different command?  What do I need to do differently?

 

It is essentially working for me actually.  I can get Hue through the browser for example.  The one thing I can't get it it do is map the ports to the *expected* ports, preserving 7180 for example.  Instead I have to use whatever crazy port number the docker arbitrarily chooses (something in the 32000s).

 

Thanks.

Re: CDH quickstart docker port mapping

Rising Star
Yeah, I understand. Docker for Mac is actually the Docker Engine for Linux running in a lightweight Linux VM so the issue you're hitting is probably somewhere in getting the port you published to a host port (which Docker sees as being the Linux instance) to be mapped to your Mac host port. Might be worth looking at Docker's issue tracker to see if someone else has had this issue, but it doesn't look to be related to CDH.
Highlighted

Re: CDH quickstart docker port mapping

New Contributor

docker run --hostname=quickstart.cloudera --privileged=true -t -i  --publish-all=true  -p 8888:8888 -p 8080:80 -p 7180:7180  image_name /usr/bin/docker-quickstart

Don't have an account?
Coming from Hortonworks? Activate your account here