Hadoop学习之FileSystem
2016-04-13 22:55
417 查看
今天学习Hadoop,遇到了个问题,问题trace大致如下:
FileSystem fSystem =FileSystem.get(new URI("hdfs://itcast:9000"), new Configuration());
java.net.ConnectException: Call From MS-201205221007/192.168.8.100 to itcast:9000 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:783)
。。。。。。。。
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
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$Connection.setupConnection(Client.java:604)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:699)
at org.apache.hadoop.ipc.Client$Connection.access$2800(Client.java:367)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1462)
at org.apache.hadoop.ipc.Client.call(Client.java:1381)
... 47 more
FileSystem.get(new URI("hdfs://itcast:9000"), new Configuration());
在确认了start-dfs.sh和start-yarn.sh都成功启动的前提下(如果将hdfs://itcast:9000的itcast换成ip地址可以成功访问),就是ip地址和主机名对应关系没有正确配置成功
查看一下windows下虚拟机的ip地址和主机的对应关系:C:\Windows\System32\drivers\etc\hosts,发现对应的主机名为it;可是在FileSystem.get(new URI("hdfs://itcast:9000"), new Configuration());中的主机名却为itcast
FileSystem fSystem =FileSystem.get(new URI("hdfs://itcast:9000"), new Configuration());
java.net.ConnectException: Call From MS-201205221007/192.168.8.100 to itcast:9000 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:783)
。。。。。。。。
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
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$Connection.setupConnection(Client.java:604)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:699)
at org.apache.hadoop.ipc.Client$Connection.access$2800(Client.java:367)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1462)
at org.apache.hadoop.ipc.Client.call(Client.java:1381)
... 47 more
FileSystem.get(new URI("hdfs://itcast:9000"), new Configuration());
在确认了start-dfs.sh和start-yarn.sh都成功启动的前提下(如果将hdfs://itcast:9000的itcast换成ip地址可以成功访问),就是ip地址和主机名对应关系没有正确配置成功
查看一下windows下虚拟机的ip地址和主机的对应关系:C:\Windows\System32\drivers\etc\hosts,发现对应的主机名为it;可是在FileSystem.get(new URI("hdfs://itcast:9000"), new Configuration());中的主机名却为itcast
相关文章推荐
- Linux驱动开发之ubuntu下的驱动编译
- 《Linux内核设计与实现》学习总结 Chap4
- 【杭电】[4349]Xiao Ming's Hope
- linux非root用户使用秘钥登陆实现方法
- apache lucene solr 官网历史版本下载地址
- Linux多线程与同步
- linux scons 实用说明(一)-g选项
- linux线程
- Linux 学习记录
- Centos 7 DNS配置及理论详解
- iOS各框架使用场景以及系统架构层次
- hadoop的shuffle
- 常用Linux命令:mount/umount/blkid
- hadoop的map的数量
- PCL使用常见问题 及安装pcl1.8.0 vs2013 及linux下
- 一款状态回放过去时索引的设置
- The Linux Storage Stack Diagram 内核 4.0 版的 I/O 栈
- Docker安装
- linux及安全《Linux内核设计与实现》第三章——20135227黄晓妍
- POJ_2186_Popular Cows