【问题标题】:Connection refused : Failed to connect to ResourceManager:8032连接被拒绝:无法连接到 ResourceManager:8032
【发布时间】:2018-02-06 16:02:52
【问题描述】:

我第一次尝试在 hadoop 上运行字数统计程序,我已经启动了 hdfs 服务并创建了文本文件作为 MapReducer 的输入,我已将文件移动到 hadoop 文件系统

我已使用此命令运行代码:

hadoop jar '/home/cloudera/wordcount.jar' WordCount /inputnew/inputFile.txt /output_new/

我得到了这些错误:

cloudera@quickstart ~]$ hadoop jar '/home/cloudera/wordcount.jar' WordCount /inputnew/inputFile.txt /output_new/
18/02/06 07:54:48 INFO client.RMProxy: Connecting to ResourceManager at quickstart.cloudera/127.0.0.1:8032
18/02/06 07:54:49 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:50 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:51 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:52 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 3 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:53 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 4 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:54 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 5 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:55 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 6 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:56 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 7 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:57 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 8 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:58 INFO ipc.Client: Retrying connect to server: quickstart.cloudera/127.0.0.1:8032. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
18/02/06 07:54:58 WARN ipc.Client: Failed to connect to server: quickstart.cloudera/127.0.0.1:8032: retries get failed due to exceeded maximum allowed retries number: 10
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:530)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:494)
    at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:648)
    at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:744)
    at org.apache.hadoop.ipc.Client$Connection.access$3000(Client.java:396)
    at org.apache.hadoop.ipc.Client.getConnection(Client.java:1555)
    at org.apache.hadoop.ipc.Client.call(Client.java:1478)
    at org.apache.hadoop.ipc.Client.call(Client.java:1439)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:230)
    at com.sun.proxy.$Proxy19.getNewApplication(Unknown Source)
    at org.apache.hadoop.yarn.api.impl.pb.client.ApplicationClientProtocolPBClientImpl.getNewApplication(ApplicationClientProtocolPBClientImpl.java:217)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:260)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:104)
    at com.sun.proxy.$Proxy20.getNewApplication(Unknown Source)
    at org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.getNewApplication(YarnClientImpl.java:206)
    at org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.createApplication(YarnClientImpl.java:214)
    at org.apache.hadoop.mapred.ResourceMgrDelegate.getNewJobID(ResourceMgrDelegate.java:187)
    at org.apache.hadoop.mapred.YARNRunner.getNewJobID(YARNRunner.java:262)
    at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:157)
    at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1307)
    at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1304)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1917)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:1304)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1325)
    at WordCount.main(WordCount.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

【问题讨论】:

  • 连接被拒绝!
  • 我该如何解决?!
  • 仅仅因为 HDFS 工作正常,并不意味着 YARN 工作正常。您的 ResourceManager 未启动。使用 Cloudera Manager 检查

标签: java hadoop mapreduce cloudera


【解决方案1】:

在 quickstart.cloudera/127.0.0.1:8032 连接到 ResourceManager

看来,您的 ResourceManager 没有运行或使用不同的端口。你可以验证一下

http://localhost:8088

假设您已更改其端口号,因为 cloudera 服务器的默认端口号为7180

如果你的服务器没有运行,你可以start cloudera server使用下面的命令

$ sudo service cloudera-scm-server start

【讨论】:

  • 8032 不是 HTTP 端口。我已经确定了你的答案。 cloudera.com/documentation/enterprise/5-14-x/topics/…
  • @cricket_007 感谢您更新我的答案。但是,我指的是根据 OP 原始问题。 (s)他似乎在使用8032 端口号。无论如何,再次感谢。 :-)
  • 资源管理器的 yarn-site 默认为 8032,但 http://resource-manager-server:8032 将始终是错误页面。就是这样
猜你喜欢
  • 2016-01-29
  • 1970-01-01
  • 2015-07-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-05-18
相关资源
最近更新 更多