我正在使用hadoop.1.0.3。一切都很好,但从今天早上起,我再也无法运行我的程序了。 例如,要运行WordCount示例,我使用此脚本:
javac -classpath $HADOOP_HOME/hadoop-core-1.0.3.jar *.java
rm -f wordcount.jar
jar cvf wordcount.jar *.class
chmod 777 wordcount.jar
rm -f output*.txt
hadoop dfs -copyFromLocal /path/to/path/input.txt /user/path/input.txt
hadoop jar wordcount.jar WordCount WordCount/input.txt output/outputWordCount
rm -f output.txt
hadoop fs -cat 'output/outputWordCount/part-*' > output.txt
hadoop dfs -rmr /user/mahnaz/output
more output.txt
启动hadoop后,运行此.sh文件并获得此结果:
$ sh run.sh
added manifest
adding: WordCount$Map.class(in = 1918) (out= 796)(deflated 58%)
adding: WordCount$Reduce.class(in = 1591) (out= 642)(deflated 59%)
adding: WordCount.class(in = 1516) (out= 743)(deflated 50%)
Warning: $HADOOP_HOME is deprecated.
copyFromLocal: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create file/path/inputEdgeCount/edge.txt. Name node is in safe mode.
Warning: $HADOOP_HOME is deprecated.
实际上在最后一次警告之后,程序将没有任何进展,我必须退出ctrl+c
你知道这是什么问题以及我该怎么做?
答案 0 :(得分:0)
这意味着您的HDFS系统仍在启动,如果您之前已成功使用它,否则可能意味着您的HDFS出现损坏或其他问题。
如果您认为一切正常,您可以尝试强制节点退出安全模式:
hdfs dfsadmin -safemode leave