我的hadoop启动后,各个节点都正常,但是无法查看hdfs目录,错误提示
Bad connection to FS. command aborted. 查了下网上的解决办法,主要是删除tmp下的所有文件,然后格式化就可以了。
原文:http://www.tuicool.com/articles/J7R3mei
问题目录表:
Bad connection to FS. command aborted. exception: Call to localhost/127.0.0.1:8888
failed on connection exception: java.net.ConnectException: Connection refused
遇到错误:
Error代码
- 11 / 08 / 18 14 : 56 : 37 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 0 time(s).
- 11 / 08 / 18 14 : 56 : 39 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 1 time(s).
- 11 / 08 / 18 14 : 56 : 41 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 2 time(s).
- 11 / 08 / 18 14 : 56 : 43 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 3 time(s).
- 11 / 08 / 18 14 : 56 : 45 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 4 time(s).
- 11 / 08 / 18 14 : 56 : 47 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 5 time(s).
- 11 / 08 / 18 14 : 56 : 49 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 6 time(s).
- 11 / 08 / 18 14 : 56 : 51 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 7 time(s).
- 11 / 08 / 18 14 : 56 : 53 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 8 time(s).
- 11 / 08 / 18 14 : 56 : 55 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 8888 . Already tried 9 time(s).
Error代码
- Bad connection to FS. command aborted. exception : Call to localhost/ 127.0 . 0.1: 88
- 88 failed on connection exception: java.net.ConnectException: Connection refused
- : no further information
- <span style= "color: #ff0000;" >
- </span>
错误提示“Bad connection to FS. command aborted. exception: Call to localhost/127.0.0.1:88
88 failed on connection exception: java.net.ConnectException: Connection refused
: no further information”
起初怀疑是fs服务没有启动,但反复关闭启动多次后仍没用,请教高手后,被建议重新格式化namenode,就可以了。
格式化指令如下(在hadoop的bin目录下):
Shell代码
- $ ./hadoop namenode -format
成功 之后重启hadoop就可以了
2,如果显示的像一下错误信息:
Error代码
- $ bin/hadoop fs -ls /
- 11 / 08 / 18 17 : 02 : 35 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 0 time(s).
- 11 / 08 / 18 17 : 02 : 37 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 1 time(s).
- 11 / 08 / 18 17 : 02 : 39 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 2 time(s).
- 11 / 08 / 18 17 : 02 : 41 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 3 time(s).
- 11 / 08 / 18 17 : 02 : 43 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 4 time(s).
- 11 / 08 / 18 17 : 02 : 45 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 5 time(s).
- 11 / 08 / 18 17 : 02 : 46 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 6 time(s).
- 11 / 08 / 18 17 : 02 : 48 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 7 time(s).
- 11 / 08 / 18 17 : 02 : 50 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 8 time(s).
- 11 / 08 / 18 17 : 02 : 52 INFO ipc.Client: Retrying connect to server: localhost/127.0 . 0
- . 1 : 9000 . Already tried 9 time(s).
Error代码
- Bad connection to FS. command aborted.
错误提示“Bad connection to FS. command aborted.”
把你DataNode上的DFS数据全删了,再重新格式化NameNode。
即:先将你D盘下tmp目录下所有文件删了,在重复上面第一点的过程
3, 在cygwin上执行wordcount时报FileNotFoundException
原因: tmp路径有问题。配置文件mapred-site.xml中mapred.child.tmp默认是"./tmp",在windows里会出问题
解决:将其改为D:/tmp(这个是windows下默认的,听说改成其他绝对路径也可以,会自动创建),之后重启hadoop即可