hadoop异常java.net.ConnectException 拒绝连接

在尝试运行Hadoop的WordCount示例时遇到了问题,日志显示应用程序因无法连接到指定地址而失败。错误信息指出连接被拒绝。解决方案可能涉及到检查和配置主机文件,确保IP地址和主机名的对应关系正确无误。
摘要由CSDN通过智能技术生成

[pipstat@PIPtest58 hadoop]$ bin/hadoop jar share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.5.2-sources.jar org.apache.hadoop.examples.WordCount input output
16/03/15 20:14:25 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
16/03/15 20:14:25 INFO client.RMProxy: Connecting to ResourceManager at /192.168.0.58:8032
16/03/15 20:14:27 INFO input.FileInputFormat: Total input paths to process : 1
16/03/15 20:14:27 INFO mapreduce.JobSubmitter: number of splits:1
16/03/15 20:14:27 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1458043844347_0001
16/03/15 20:14:28 INFO impl.YarnClientImpl: Submitted application application_1458043844347_0001
16/03/15 20:14:28 INFO mapreduce.Job: The url to track the job: http://press5.cn:8088/proxy/application_1458043844347_0001/
16/03/15 20:14:28 INFO mapreduce.Job: Running job: job_1458043844347_0001
16/03/15 20:14:50 INFO mapreduce.Job: Job job_1458043844347_0001 running in uber mode : false
16/03/15 20:14:50 INFO mapreduce.Job: map 0% reduce 0%
16/03/15 20:14:50 INFO mapreduce.Job: Job job_1458043844347_0001 failed with state FAILED due to: Application application_1458043844347_0001 failed 2 times due to Error launching appattempt_1458043844347_0001_000002. Got exception: java.net.ConnectException: Call From PIPtest58/192.168.0.58 to press5.cn:45226 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:783)
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:730)
at org.apache.hadoop.ipc.Client.call(Client.java:1415)
at org.apache.hadoop.ipc.Client.call(Client.java:1364)
at org.apache.hadoop.ipc.ProtobufRpcEngine I n v o k e r . i n v o k e ( P r o t o b u f R p c E n g i n e . j a v a : 206 ) a t c o m . s u n . p r o x y . Invoker.invoke(ProtobufRpcEngine.java:206) at com.sun.proxy. Invoker.invoke(ProtobufRpcEngine.java:206)atcom.sun.proxy.Proxy78.startContainers(Unknown Source)
at org.apache.hadoop.yarn.api.impl.pb.client.ContainerManagementProtocolPBClientImpl.startContainers(ContainerManagementProtocolPBClientImpl.java:96)
at org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncher.launch(AMLauncher.java:118)
at org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncher.run(AMLauncher.java:249)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor W o r k e r . r u n ( T h r e a d P o o l E x e c u t o r . j a v a : 617 ) a t j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 745 ) C a u s e d b y : j a v a . n e t . C o n n e c t E x c e p t i o n : 拒绝连接 a t s u n . n i o . c h . S o c k e t C h a n n e l I m p l . c h e c k C o n n e c t ( N a t i v e M e t h o d ) a t s u n . n i o . c h . S o c k e t C h a n n e l I m p l . f i n i s h C o n n e c t ( S o c k e t C h a n n e l I m p l . j a v a : 717 ) a t o r g . a p a c h e . h a d o o p . n e t . S o c k e t I O W i t h T i m e o u t . c o n n e c t ( S o c k e t I O W i t h T i m e o u t . j a v a : 206 ) a t o r g . a p a c h e . h a d o o p . n e t . N e t U t i l s . c o n n e c t ( N e t U t i l s . j a v a : 529 ) a t o r g . a p a c h e . h a d o o p . n e t . N e t U t i l s . c o n n e c t ( N e t U t i l s . j a v a : 493 ) a t o r g . a p a c h e . h a d o o p . i p c . C l i e n t Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.ConnectException: 拒绝连接 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:529) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:493) at org.apache.hadoop.ipc.Client Worker.run(ThreadPoolExecutor.java:617)atjava.lang.Thread.run(Thread.java:745)Causedby:java.net.ConnectException:拒绝连接atsun.nio.ch.SocketChannelImpl.checkConnect(NativeMethod)atsun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)atorg.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)atorg.apache.hadoop.net.NetUtils.connect(NetUtils.java:529)atorg.apache.hadoop.net.NetUtils.connect(NetUtils.java:493)atorg.apache.hadoop.ipc.ClientConnection.setupConnection(Client.java:606)
at org.apache.hadoop.ipc.Client C o n n e c t i o n . s e t u p I O s t r e a m s ( C l i e n t . j a v a : 700 ) a t o r g . a p a c h e . h a d o o p . i p c . C l i e n t Connection.setupIOstreams(Client.java:700) at org.apache.hadoop.ipc.Client Connection.setupIOstreams(Client.java:700)atorg.apache.hadoop.ipc.ClientConnection.access$2800(Client.java:367)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1463)
at org.apache.hadoop.ipc.Client.call(Client.java:1382)
… 9 more
. Failing the application.
16/03/15 20:14:50 INFO mapreduce.Job: Counters: 0

解决方案:
/etc/host文件里
配置方法
ip地址 主机名 域名
ip地址 主机名 域名
ip地址 主机名 域名

说明:ip地址为第一列,主机名为第二列
如果域名也主机名写反了,就会出现上边的连接异常

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值