配置好eclipse,在執行run on hadoop的時候,提示
11/03/29 16:47:59 WARN conf.Configuration: DEPRECATED: hadoop-site.xml found in the classpath. Usage of hadoop-site.xml is deprecated. Instead use core-site.xml, mapred-site.xml and hdfs-site.xml to override properties of core-default.xml, mapred-default.xml and hdfs-default.xml respectively
11/03/29 16:48:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s).
11/03/29 16:48:02 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 1 time(s).
11/03/29 16:48:03 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 2 time(s).
11/03/29 16:48:04 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 3 time(s).
11/03/29 16:48:05 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 4 time(s).
11/03/29 16:48:06 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 5 time(s).
11/03/29 16:48:07 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 6 time(s).
11/03/29 16:48:08 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 7 time(s).
11/03/29 16:48:09 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 8 time(s).
11/03/29 16:48:10 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 9 time(s).
Exception in thread "main" java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused
補充:1. eclipse已經連接上hdfs,文件夾也上傳至hdfs中
2. hdfs的安全模式也已經取消,hadoop dfsadmin -safemode leave
3. 在運行配置的時候,名稱用的也不是localhost(localhost鏈接不上hdfs),用的是機器名稱
4.hadoop已經配置好,wordcount程序在命令行裏能成功運行,個人hadoop的是徹底分佈模式,1個namenode,4個datanodejava
問題終於解決了!困擾我很久的問題啊!解決方法:
將eclipse運行配置中的arguments中 hdfs://localhost:9000/user/lxz/testin hdfs://localhost:9000/user/lxz/testout
改成:
hdfs://lxz-pc:9000/user/lxz/testin hdfs://lxz-pc:9000/user/lxz/testout
即:把localhost改成你的namenode的機器名,改成ip不行,我試過
但願能幫助到和我遇到了一樣問題的朋友!node
mac主機名在 系統偏好設置->共享中設置:XXX.local安全
在終端上能夠用 uname -n或hostname -f的方式來查看eclipse
Arguments配置:ide
hdfs://ruancc.local:9000/Users/mac/wordcount.txt hdfs://ruancc.local:9000/Users/mac/outputoop
ToolRunner與eclipse hadoop 插件的替代品,簡化M/R程序的開發spa