Published

五 05 七月 2013

←Home

dfs.data.dir文件权限导致DATANODE启动失败

namenode启动正常,datanode起不来,查看日志发现这么一段:

2013-07-05 13:39:18,667 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.properties
2013-07-05 13:39:18,677 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source MetricsSystem,sub=Stats registered.
2013-07-05 13:39:18,678 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
2013-07-05 13:39:18,678 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: DataNode metrics system started
2013-07-05 13:39:18,752 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source ugi registered.
2013-07-05 13:39:18,788 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: **Invalid directory in dfs.data.dir: Incorrect permission for /data/java/hadoop-1.0.3/data/dfs.data.dir, expected: rwxr-xr-x, while actual: rwxrwxrwx**
2013-07-05 13:39:18,788 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: All directories in dfs.data.dir are invalid.
2013-07-05 13:39:18,788 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Exiting Datanode
2013-07-05 13:39:18,789 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:

注意粗体部分,意思是dfs.data.dir权限现为rwxrwxrwx,而它对此文件的权限要求为rwxr-xr-x,这一点还真没注意过。 于是按它的要求root权限下chmod 755 /data/java/hadoop-1.0.3/data/dfs.data.dir 然后重启hadoop集群,问题解决。

Go Top
comments powered by Disqus