> 文档中心 > MR程序异常处理(一)

MR程序异常处理(一)

跑MR出现如下异常(最全解决方案在最下面):

2020/11/01 14:11:29,014 [main] [org.apache.hadoop.ipc.Client] [INFO] - Retrying connect to server: MR/192.168.126.134:9000. Already tried 0 time(s); maxRetries=452020/11/01 14:11:49,016 [main] [org.apache.hadoop.ipc.Client] [INFO] - Retrying connect to server: MR/192.168.126.134:9000. Already tried 1 time(s); maxRetries=452020/11/01 14:12:09,016 [main] [org.apache.hadoop.ipc.Client] [INFO] - Retrying connect to server: MR/192.168.126.134:9000. Already tried 2 time(s); maxRetries=452020/11/01 14:12:29,017 [main] [org.apache.hadoop.ipc.Client] [INFO] - Retrying connect to server: MR/192.168.126.134:9000. Already tried 3 time(s); maxRetries=45Exception in thread "main" java.net.ConnectException: Call From DESKTOP-LE91M5E/192.168.126.1 to MR:9000 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefusedat 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:423)at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:791)at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:731)at org.apache.hadoop.ipc.Client.call(Client.java:1472)at org.apache.hadoop.ipc.Client.call(Client.java:1399)at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)at com.sun.proxy.$Proxy9.delete(Unknown Source)at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.delete(ClientNamenodeProtocolTranslatorPB.java:521)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)at com.sun.proxy.$Proxy10.delete(Unknown Source)at org.apache.hadoop.hdfs.DFSClient.delete(DFSClient.java:1929)at org.apache.hadoop.hdfs.DistributedFileSystem$12.doCall(DistributedFileSystem.java:638)at org.apache.hadoop.hdfs.DistributedFileSystem$12.doCall(DistributedFileSystem.java:634)at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)at org.apache.hadoop.hdfs.DistributedFileSystem.delete(DistributedFileSystem.java:634)at net.hw.mr2.ZebraDriver.main(ZebraDriver.java:37)Caused by: java.net.ConnectException: Connection refused: no further informationat 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:530)at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:494)at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:607)at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:705)at org.apache.hadoop.ipc.Client$Connection.access$2800(Client.java:368)at org.apache.hadoop.ipc.Client.getConnection(Client.java:1521)at org.apache.hadoop.ipc.Client.call(Client.java:1438)... 17 more

方法一:查看Hadoop进程是否成功启动
\\启动全部进程
命令:start-all.sh
方法二:linux是否关闭防火墙
\\关闭防火墙
命令:systemctl stop firewalld
如果还是不行,留言区展现一下你的报错异常。
(解决方案千千种,在坐的各位还有其他好方法,评论区一起讨论)