Window下使用eclipse连接hadoop报错(二)


  1. 报错

15/05/10 14:12:11 INFOip.Client: Retrying connect to server: hadoop/192.168.110:9000.Already tried 0time(s); maxRet


15/05/10 14:12:11 INFOip.Client: Retrying connect to server: hadoop/192.168.110:9000.Already tried 1time(s); maxRet


15/05/10 14:12:11 INFOip.Client: Retrying connect to server: hadoop/192.168.110:9000.Already tried 2time(s); maxRet



可能原因1)网络原因:关闭防火墙我就是在这里栽跟头了

永久关闭防火墙         关闭: chkconfigiptables off

即时生效,重启后复原   关闭: service iptables stop

2)参数原因:(网上说法)

原因是:hadoop默认配置是把一些tmp文件放在/tmp目录下,重启系统后,tmp目录下的东西被清除,所以报错  解决方法:在conf/core-site.xml0.19.2版本的为conf/hadoop-site.xml)中增加以下内容

 <property>

<name>hadoop.tmp.dir</name>

<value>/usr/newdir/hadoop/tmp</value>

<description>Abase for other temporary directories</description>

 </property>

重启hadoop后,格式化namenode即可

  1. 报错Exceptionin thread "main" java.io.FileNotFoundException: File does not exist: /hello      atorg.apache.hadoop.hdfs.DFSClient$DFSInputStream.fetchLocatedBlocks(DFSClient.java:2006)

   atorg.apache.hadoop.hdfs.DFSClient$DFSInputStream.openInfo(DFSClient.java:1975)

   atorg.apache.hadoop.hdfs.DFSClient$DFSInputStream.<init>(DFSClient.java:1967)

   atorg.apache.hadoop.hdfs.DFSClient.open(DFSClient.java:735)

   atorg.apache.hadoop.hdfs.DistributedFileSystem.open(DistributedFileSystem.java:165)

   atorg.apache.hadoop.fs.FileSystem.open(FileSystem.java:436)

   atorg.apache.hadoop.fs.FsUrlConnection.connect(FsUrlConnection.java:46)

   atorg.apache.hadoop.fs.FsUrlConnection.getInputStream(FsUrlConnection.java:56)

   atjava.net.URL.openStream(URL.java:1037)

   athdfs.App1.main(App1.java:20)

问题原因:HDFS根目录下没有hello文件

解决方法新建hello文件上传到HDFS

        touch hello

        vi hello   

            hello you

            hello me

         hadoop fs –put ./hello  /

       重新连接成功问题解决


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值