日期:2014-05-17  浏览次数:21117 次

windows下跑伪分布hadoop,问题小记

问题目录表:

1,Bad connection to FS. command aborted. exception: Call to localhost/127.0.0.1:8888

failed on connection exception: java.net.ConnectException: Connection refused


2,Bad connection to FS. command aborted.

3,在cygwin上执行wordcount时报FileNotFoundException

?

1, windows下,在安装完cygwin,并配置好hadoop参数,到hadoop的bin目录下执行以下代码,

?

$ ./hadoop fs -ls / 

?

?遇到错误:

?

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).
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

错误提示“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目录下):

?

$ ./hadoop namenode -format

成功 之后重启hadoop就可以了

?

2,如果显示的像一下错误信息:

?

$ 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: local