big-data-europe / docker-hadoop

Apache Hadoop docker image
2.18k stars 1.28k forks source link

Datanode, nodemanager and historyserver not started in Swarm mode #64

Open simcheuk opened 4 years ago

simcheuk commented 4 years ago

I tried to run the compose v3 file from the repo at swarm mode with 3 nodes. namenode and resourcemanager can run perfectly. But the remaining services just kept starting and starting and threw out an error "task: non-zero exit (137)".

Does anyone have any idea?

apurrinos-smartclip commented 4 years ago

I have the same issue. If I do docker logs <container_id>, being container_id one of the services refusing to start (i.e., a datanode) I get this:

[...]
[20/100] check for namenode:50070...
[20/100] namenode:50070 is not available yet
[20/100] try in 5s once again ...
[21/100] check for namenode:50070...
[21/100] namenode:50070 is not available yet
[21/100] try in 5s once again ...
[...]

It seems to be a network trouble, still not sure if it has to do with namenode reachability or with port 50070.

Executing docker ps in my master node, this is the status of namenode:

7e6a01e3d912        bde2020/hadoop-namenode:2.0.0-hadoop3.2.1-java8          "/entrypoint.sh /run…"   2 hours ago         Up 2 hours (healthy)               9870/tcp            hadoop_namenode.1.xao712lu4mnmkgfrwx9f44j03

It only exposes port 9870, but I'm not so sure that it needs to expose hdfs por 50070 as well. If I get further advance, I'll let you know.

lipeng186 commented 4 years ago

hadoop 3 port 50070 change 9870 egs: sort apps Haddop2.xport Haddop 3 port NNPorts Namenode 8020 9820 NNPorts NN HTTP UI 50070 9870 NNPorts NN HTTPS UI 50470 9871 SNN ports SN NHTTP 50091 9869 SNN ports SNN HTTP UI 50090 9868 DN ports DN IPC 50020 9867 DN ports DN 50010 9866 DN ports DN HTTP UI 50075 9864 DN ports Namenode 50475 9865 you should change this file docker-compose-v3.yml ,such as

resourcemanager: image: bde2020/hadoop-resourcemanager:2.0.0-hadoop3.2.1-java8 networks:

haojunyu commented 4 years ago

From hadoop 3.1.3 official web, we can see default settings: dfs.namenode.http-address 0.0.0.0:9870 dfs.datanode.http.address 0.0.0.0:9864 So you can change all environment SERVICE_PRECONDITION in docker-compose-v3.yml

environment:
      SERVICE_PRECONDITION: "namenode:9870 datanode:9864"
rhasanm commented 9 months ago

In addition to @haojunyu's answer, I also had to manage the placement check on the services. For if someone don't know yet the placement things in swarm just removing these lines will work.

` placement: constraints: