启动失败报错1:
2014-03-11 12:39:06,725 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Exception in secureMain
java.io.IOException: Incorrect configuration: namenode address dfs.namenode.servicerpc-address or dfs.namenode.rpc-address is not configured.
at org.apache.hadoop.hdfs.DFSUtil.getNNServiceRpcAddresses(DFSUtil.java:668)
at org.apache.hadoop.hdfs.server.datanode.BlockPoolManager.refreshNamenodes(BlockPoolManager.java:151)
at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:673)
at org.apache.hadoop.hdfs.server.datanode.DataNode.(DataNode.java:259)
at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:1727)
at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1642)
at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1665)
at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:1837)
at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:1858)
2014-03-11 12:39:06,732 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2014-03-11 12:39:06,738 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:
/**************************************************
SHUTDOWN_MSG: Shutting down DataNode at node1/192.168.26.160
启动失败解决1:
检查配置文件时,发现node1,node2没有复制core-site.xml文件,复制后再次启动正常.
启动失败报错2:
WARN fs.FileUtil: Failed to delete file or dir [/data/hadoop/dfs/name/current]: it still exists.
15/01/21 05:21:17 WARN namenode.NameNode: Encountered exception during format:
java.io.IOException: Cannot remove current directory: /data/hadoop/dfs/name/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:332)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:546)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:567)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:148)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:899)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1310)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1424)
15/01/21 05:21:17 FATAL namenode.NameNode: Exception in namenode join
java.io.IOException: Cannot remove current directory: /data/hadoop/dfs/name/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:332)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:546)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:567)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:148)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:899)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1310)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1424)
启动失败解决2:
jps显示的结果是5432 Jps
主要原因是在配置hadoop是使用的root用户,然而格式化测试使用的是hadoop用户,所以出现以上的问题!
解决办法是将hadoop的安装目录的owner更改成hadoop,然后重新格式化就可以了
具体操作是chown -R hadoop /usr/local/Hadoop-2.6.0
注释:如果去掉-R就是更改一个文件或者文件夹,如果有-R就把整个文件目录下的文件都更改过来了
启动失败报错3:WARNorg.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server:hadoop1/192.168.10.22:9000
2014-05-04 10:43:55,009 INFOorg.apache.hadoop.ipc.Client: Retrying connect to server:hadoop1/192.168.10.22:9000. Already tried 0 time(s); retry policy isRetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
2014-05-04 10:43:56,012 INFOorg.apache.hadoop.ipc.Client: Retrying connect to server:hadoop1/192.168.10.22:9000. Already tried 1 time(s); retry policy isRetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
启动失败解决3:
如果你已经检查了datanode以及namenode的连通性,ip都正确,但是仍然没法解决问题,那么可以接着往下看了。
其实根本原因还是无法连接到192.168.100.187:9000 相应ip的相应端口。
查看一下namenode的端口坚挺情况:
[hdp@hadoop1 sbin]$ netstat -an | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:37072 127.0.0.1:9000 TIME_WAIT
其实问题就再这里,hadoop启动的时候只监听了127.0.0.1一个端口,而不是192.168.100.187:9000。这种情况下,也就只有本机才能联通127.0.0.1:9000了。
看来是ip解析的问题,看一下namenode的hosts文件(只列出了重要部分):
127.0.0.1 hadoop1 localhost.localdomainlocalhost
::1 localhost6.localdomain6 localhost6
其实主要问题就是只要将hadoop1去掉即可。
重启hdfs后检查一下端口监听情况:
[root@hadoop1 network-scripts]# netstat -an | grep 9000
tcp 0 0 192.168.10.22:9000 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.22:9000 192.168.10.24:51040 ESTABLISHED
tcp 0 0 192.168.10.22:41116 192.168.10.22:9000 TIME_WAIT
tcp 0 0 192.168.10.22:9000 192.168.10.23:46070 ESTABLISHED
修改后datanode就可以正常连接namenode了。
启动失败报错4:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform…
using builtin-java classes where applicable
启动失败解决4:
不用管它 ╮(╯_╰)╭