18

I have installed the cloudera quickstart using docker based on the instructions given here.

https://blog.cloudera.com/blog/2015/12/docker-is-the-new-quickstart-option-for-apache-hadoop-and-cloudera/

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

You can see that I am doing -p 7180 and -p 8888 for port mapping.

when the container booted successfully. I saw that the hue service startup failed. but i ran it manually using sudo service hue restart and it showed OK.

Now I ran

/home/cloudera/cloudera-manager --express --force

this command was successful I got a message to connect to the CM using http://cloudera.quickstart:7180

Now on my host machine I did docker-machine env default and I could see the output

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/abhishek.srivastava/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"

Now in my browser on host machine I did

http://192.168.99.100:7180
http://192.168.99.100:8888
http://quickstart.cloudera:7180
http://quickstart.cloudera:8888

but everything fails to connect to any page. So even after doing port forwarding... I am not able to access either cloudera manager or HUE UI from the host machine.

I am using OSX.

I also went into virtualbox manager UI and selected the default VM. I went into settings -> network -> port forwarding. and made the following entries

enter image description here

but still I cannot access the cloudera manager and HUE....

Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
  • From my answers, do realize there is no real advantage to using the Docker quickstart image on Mac or Windows? It is still virtualized and you need to fix all the memory and networking problems associated with that. – OneCricketeer Dec 21 '15 at 03:38
  • Does docker-machine edit the hosts file so you can access it via the hostname? Anyways, try using a port mapping in your docker command. For example `-p 7180:7180` – OneCricketeer Dec 31 '15 at 12:24

6 Answers6

6

When you run docker using -p 7180 and -p 8888, it will allocate a random port on your windows host. However, if you use -p 7180:7180 and -p 8888:8888, assuming those ports are free on the host, it will map them directly.

Otherwise you can execute docker ps and it will show you which ports it mapped the 7180 and 8888 to. Then in your host browser you can enter

http://192.168.99.100:<docker-allocated-port>

instead of

http://192.168.99.100:7180

If its all on your local machine, you shouldn't need the port forwarding.

AndrewSP
  • 81
  • 1
  • 4
5

Since you're running the docker machine inside a VM, you need to open the port on VirtualBox.

You can do this from the Port Forwarding button in the network adapter panel in VirtualBox.

Settings > Network > Advanced > Port Forwarding

You should see an SSH port already being forwarded for docker. Just add any additional ports like that one.

And here are lists of all the ports used by CDH. Of course you don't need all of them. I would suggest at least Cloudera Manager (7180), namenode and datanode UI (50070 & 50075), and the job servers like mapreduce (8088,8042 & 10020) or spark (18080 & 18081). And I personally don't use it, but Hue is 8888.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
2

The same issue happened to me. I was able start hue successfully after increasing the number of CPUs in VirtualBox. I also increased the amount of RAM earlier. The original CPU I had was 1, changed to 3

Screenshot of virtual box cpu settings -> Click here

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Ronald Teo
  • 31
  • 2
2

I have encountered the same issue here, and resolved now based on the comments and posts above. There are two issues mentioned above:

  1. Failed to start Hue. In my case, this is caused by limited resources allocated with default docker VM settings. According to @Ronald Teo's answer, going to

    VirtualBox -> 'default'[your docker-machine name] -> Settings -> System

    , increase base memory to 8192MB, and processors to at least 3, have fixed my problem.

  2. Can not access Hue from my host machine. Based on the original post, Try docker run --privileged=true --hostname=quickstart.cloudera -p 7180:7180 -p 8888:8888 -t -i 9f3ab06c7554 /usr/bin/docker-quickstart should solve this problem.

Ding Wei
  • 21
  • 2
2

Restart Hue after container is up

Increase the memory of docker to 8GB if you can. Otherwise, set it at least 4GB. Let hue fail while starting the container. After that, attach to the docker container and access its shell to run the following command,

To stop the Hue Server:

$ sudo service hue stop

To start the Hue Server:

$ sudo service hue start
Sergey Bushmanov
  • 23,310
  • 7
  • 53
  • 72
deo
  • 916
  • 7
  • 8
  • This worked for me on 6GB allocation and restarting Hue service. Just a trial and error basis. – deo Oct 01 '16 at 01:19
1

I was just trying to spin up the Cloudera quickstart docker myself, and it turns out this seems to do the trick:

http://127.0.0.1:8888

Note the http, not https, and that I use 127.0.0.1 (or localhost) Note that this assumes that the internal 8888 port is mapped to your 8888 port.

Suppose docker inspect yields something like

            "8888/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "32769"
                }

Then you would want

http://127.0.0.1:32769

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122