hadoop java socketexception无效参数

czfnxgou  于 2021-06-03  发布在  Hadoop
关注(0)|答案(2)|浏览(469)

我在学习hadoop,它让我发疯了!我能做什么?

root@youcheng1-OEM:/usr/local/hadoop-2.2.0# bin/hadoop fsck /      
DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it.
13/11/05 08:55:14 WARN fs.FileSystem: "1" is a deprecated filesystem name. Use "hdfs://1/" instead.  
13/11/05 08:55:20 ERROR  security.UserGroupInformation: PriviledgedActionException as:root       
(auth:SIMPLE) cause:java.io.IOException: Failed on local exception: java.net.SocketException: 无效的参数; Host Details : 
local host is: "youcheng1-OEM/192.168.1.192"; 
destination host is: "0.0.0.1":8020;      
Exception in thread "main" java.io.IOException: Failed on local exception: java.net.SocketException: 无效的参数; 
Host Details : local host is: "youcheng1-OEM/192.168.1.192"; 
destination host is: "0.0.0.1":8020;    
at  org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:764)     
at  org.apache.hadoop.ipc.Client.call(Client.java:1351)     
at  org.apache.hadoop.ipc.Client.call(Client.java:1300)     
at  org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)      
at  com.sun.proxy.$Proxy9.getFileInfo(Unknown Source)   
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:186)     
at  org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)  
at  com.sun.proxy.$Proxy9.getFileInfo(Unknown Source)   
at  org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:651)       
at  org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1679)       
at  org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1106)   
at  org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1102)   
at  org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)            at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1102)
at  org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1397)    
at  org.apache.hadoop.hdfs.HAUtil.getAddressOfActive(HAUtil.java:303)   
at  org.apache.hadoop.hdfs.tools.DFSck.getCurrentNamenodeAddress(DFSck.java:229)    
at  org.apache.hadoop.hdfs.tools.DFSck.doWork(DFSck.java:235)   
at  org.apache.hadoop.hdfs.tools.DFSck.access$000(DFSck.java:71)    
at  org.apache.hadoop.hdfs.tools.DFSck$1.run(DFSck.java:134)    
at  org.apache.hadoop.hdfs.tools.DFSck$1.run(DFSck.java:131)    
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:1491)    
at  org.apache.hadoop.hdfs.tools.DFSck.run(DFSck.java:130)  
at  org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)   
at  org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)   
at  org.apache.hadoop.hdfs.tools.DFSck.main(DFSck.java:316) Caused by:       java.net.SocketException: 无效的参数    
at  sun.nio.ch.Net.connect0(Native       Method)    
at  sun.nio.ch.Net.connect(Net.java:465)    
at  sun.nio.ch.Net.connect(Net.java:457)    
at  sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:666)    
at  org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:192)     
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$Connection.setupConnection(Client.java:547)    
at  org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:642)      
at  org.apache.hadoop.ipc.Client$Connection.access$2600(Client.java:314)    
at  org.apache.hadoop.ipc.Client.getConnection(Client.java:1399)    
at  org.apache.hadoop.ipc.Client.call(Client.java:1318)     
... 30    more
ct3nt3jp

ct3nt3jp1#

在/etc/hosts文件中添加以下行

0.0.0.1 localhost
5sxhfpxr

5sxhfpxr2#

我也犯了同样的错误( SocketException: invalid paramemter )尝试从另一个主机连接到hdfs namenode时。
如果你能跑的话 bin/hadoop fs -ls / 在namenode上,则应该检查 /etc/hosts 在客户端主机(或运行datanode的主机)上。在你的情况下,寻找线“ 127.0.0.1 youcheng1-OEM ". 我通过添加以下行修复了问题:


# 127.0.0.1 youcheng1-OEM

127.0.0.1 localhost
192.168.1.192 youcheng1-OEM

hadoop似乎解决了这个问题 youcheng1-OEM 作为 127.0.0.1 把它传给 sun.nio.ch.SocketChannelImpl.connect(...) .

相关问题