Hadoop error: Bad connection to FS. command aborted.

运行

hadoop fs -ls

时出现错误如下:

root@ubuntu:/home/chenwq/hadoop/book/ch03/src/main/java# hadoop fs -ls
11/08/31 22:51:37 INFO security.Groups: Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping; cacheTimeout=300000
11/08/31 22:51:38 WARN conf.Configuration: mapred.task.id is deprecated. Instead, use mapreduce.task.attempt.id
11/08/31 22:51:39 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 0 time(s).
11/08/31 22:51:40 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 1 time(s).
11/08/31 22:51:41 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 2 time(s).
11/08/31 22:51:42 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 3 time(s).
11/08/31 22:51:43 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 4 time(s).
11/08/31 22:51:44 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 5 time(s).
11/08/31 22:51:45 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 6 time(s).
11/08/31 22:51:46 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 7 time(s).
11/08/31 22:51:47 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 8 time(s).
11/08/31 22:51:48 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 9 time(s).
Bad connection to FS. command aborted.

 

 

解决方案:

格式化namenode:

hadoop namenode -format

重新启动start-all.sh,输入

jps

 

查看后台进程

root@ubuntu:/home/chenwq/hadoop/hadoop-0.21.0/bin# jps
8734 NameNode
8934 DataNode
9137 SecondaryNameNode
9479 Jps

此时namenode启动

 

运行

hadoop fs -ls

出现:

11/08/31 23:09:37 INFO security.Groups: Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping; cacheTimeout=300000
11/08/31 23:09:37 WARN conf.Configuration: mapred.task.id is deprecated. Instead, use mapreduce.task.attempt.id
Found 1 items
-rw-r--r--   1 root supergroup        628 2011-08-31 23:01 /user/root/books/URLCat.java

  

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值