sequenceiq / hadoop-docker

Hadoop docker image
https://registry.hub.docker.com/u/sequenceiq/hadoop-docker/
Apache License 2.0
1.21k stars 560 forks source link

Site unreachable with Hadoop on Docker #83

Open nlamblin opened 5 years ago

nlamblin commented 5 years ago

I try to use Hadoop with Docker Toolbox on Windows 10 Family. So I followed this setup : https://linoxide.com/cluster/setup-single-node-hadoop-cluster-docker/

  1. Download the image --> OK

  2. Run the container --> OK

    $ docker run -it sequenceiq/hadoop-docker:2.7.1 /etc/bootstrap.sh -bash/
    Starting sshd:                                             [  OK  ]
    18/11/16 10:38:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    Starting namenodes on [c13feb9767ac]
    c13feb9767ac: starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-c13feb9767ac.out
    localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root- datanode-c13feb9767ac.out
    Starting secondary namenodes [0.0.0.0]
    0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-root-secondarynamenode-c13feb9767ac.out
    18/11/16 10:40:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    starting yarn daemons
    starting resourcemanager, logging to /usr/local/hadoop/logs/yarn--resourcemanager-c13feb9767ac.out
    localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-c13feb9767ac.out
  3. Run jps command --> OK

    bash-4.1# jps
    119 NameNode
    535 ResourceManager
    200 DataNode
    656 Jps
    319 SecondaryNameNode
    620 NodeManager
  4. Get IP adress --> OK

    bash-4.1# ifconfig
    ...
    inet addr:172.17.0.2
    ...
  5. Go to browser (Google Chrome v70) --> KO Address used : 172.17.0.2:50070

Error :

This site is unreachable 172.17.0.2 took too long to answer.

Can you help me to fix it please? If you need more informations ask me.

Thanks.

jinzongna commented 5 years ago

You should not use default command to create the docker container, if you want to access the hadoop web sites. The default command does not expose the ports out of the container. Try this command to create a new container which mapping 8088 and 50070 port to localhost. docker run -it -p 8088:8088 -p 50070:50070 sequenceiq/hadoop-docker:2.7.1 /etc/bootstrap.sh -bash Use http://localhost:50070 to browse hadoop web site.

Good Luck!

navneet1075 commented 5 years ago

thanks a lot . works like a charm !!

vasu-hr commented 4 years ago

If you want to access hadoop website outside your localhost as below http://:50070/

then you can run below command

sudo docker run -it -p 8088:8088 -p 50070:50070 --hostname sequenceiq/hadoop-docker:2.7.0 /etc/bootstrap.sh -bash