首页 > 解决方案 > Hadoop docker:无法连接到资源管理器

问题描述

我对 docker 非常陌生,并尝试在 ubuntu 服务器中使用 docker 配置单节点 hadoop。这是我已经做过的。

$ docker pull sequenceiq/hadoop-docker:2.7.1
 ......
$ docker run -it sequenceiq/hadoop-docker:2.7.1 /etc/bootstrap.sh -bash
Starting sshd:                                             [  OK  ]
18/06/27 12:59:00 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [cb46e163e0be]
cb46e163e0be: starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-cb46e163e0be.out
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-cb46e163e0be.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-root-secondarynamenode-cb46e163e0be.out
18/06/27 12:59:26 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-cb46e163e0be.out
localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-cb46e163e0be.out
bash-4.1# jps
532 ResourceManager
204 DataNode
118 NameNode
371 SecondaryNameNode
918 Jps
620 NodeManager

jps显示资源管理器正在运行。现在我尝试测试hadoop

bash-4.1# cd $HADOOP_PREFIX
bash-4.1# bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.1.jar grep input output 'dfs[a-z.]+'
18/06/27 13:02:23 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18/06/27 13:02:25 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
18/06/27 13:02:27 INFO input.FileInputFormat: Total input paths to process : 31
18/06/27 13:02:27 INFO mapreduce.JobSubmitter: number of splits:31
18/06/27 13:02:28 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1530118774059_0001
18/06/27 13:02:28 INFO impl.YarnClientImpl: Submitted application application_1530118774059_0001
18/06/27 13:02:28 INFO mapreduce.Job: The url to track the job: http://cb46e163e0be:8088/proxy/application_1530118774059_0001/
18/06/27 13:02:28 INFO mapreduce.Job: Running job: job_1530118774059_0001
18/06/27 13:02:44 INFO mapreduce.Job: Job job_1530118774059_0001 running in uber mode : false
18/06/27 13:02:44 INFO mapreduce.Job:  map 0% reduce 0%
18/06/27 13:05:56 INFO ipc.Client: Retrying connect to server: cb46e163e0be/172.17.0.2:42698. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
18/06/27 13:05:57 INFO ipc.Client: Retrying connect to server: cb46e163e0be/172.17.0.2:42698. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
18/06/27 13:05:58 INFO ipc.Client: Retrying connect to server: cb46e163e0be/172.17.0.2:42698. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
18/06/27 13:05:59 INFO ipc.Client: Retrying connect to server: cb46e163e0be/172.17.0.2:42698. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
18/06/27 13:06:00 INFO ipc.Client: Retrying connect to server: cb46e163e0be/172.17.0.2:42698. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
18/06/27 13:06:01 INFO ipc.Client: Retrying connect to server: cb46e163e0be/172.17.0.2:42698. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
^C
bash-4.1# jps
532 ResourceManager
204 DataNode
1671 Jps
371 SecondaryNameNode

bash-4.1#

现在我不明白这里有两件事。

  1. 这是hadoop的官方形象,为什么它不能正常运行?我犯了什么错误吗?如果是,那又如何?

  2. 当我jps在运行示例代码之前执行此操作时,您可以看到node manager并由. 但是在运行示例并退出示例后,这对对象并没有返回。为什么会这样?name nodejpsjps

请帮忙。谢谢

标签: dockerhadoopconfiguration

解决方案


推荐阅读