ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: All directories in dfs.data.dir are invalid

几天前配置好了hadoop1.2.1,一直好好的。自从更改了core-site.xml中的hadoop.tmp.dir为/home/caiyong/hadoop_tmp后,启动hadoop,jps查看只有5个进程,DataNode始终不见,重启了几次还是看不到DataNode进程。查看日志发现如下错误:

2015-01-22 11:48:55,063 INFO org.apache.hadoop.hdfs.server.datanode.DataNode:
STARTUP_MSG: /************************************************************ 
STARTUP_MSG: Starting DataNode STARTUP_MSG: host = cy-ubuntu/127.0.1.1 STARTUP_MSG: 
args = [] STARTUP_MSG: version = 1.2.1
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152; 
compiled by 'mattf' on Mon Jul 22 15:23:09 PDT 2013 STARTUP_MSG: 
java = 1.7.0_25 ************************************************************/ 
2015-01-22 11:48:57,531 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.properties 
2015-01-22 11:48:57,651 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source MetricsSystem,sub=Stats registered. 
2015-01-22 11:48:57,672 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
2015-01-22 11:48:57,672 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: DataNode metrics system started 
2015-01-22 11:49:01,155 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source ugi registered. 
2015-01-22 11:49:01,209 WARN org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Source name ugi already exists! 
2015-01-22 11:49:02,412 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Invalid directory in dfs.data.dir: 
Incorrect permission for /home/caiyong/hadoop_tmp/dfs/data, expected: rwxr-xr-x, while actual: rwxrwxr-x 
2015-01-22 11:49:02,412 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: All directories in dfs.data.dir are invalid. 
2015-01-22 11:49:02,412 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Exiting Datanode 
2015-01-22 11:49:02,490 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: 
SHUTDOWN_MSG: /************************************************************ 
SHUTDOWN_MSG: Shutting down DataNode at cy-ubuntu/127.0.1.1 ************************************************************/ 

因为
/home/caiyong/hadoop_tmp/dfs/data的权限有问题,要将现在的权限 rwxrwxr-x改成rwxr-xr-x,即删除对于group的w权限。

执行如下命名:

sudo chmod g-w /home/caiyong/hadoop_tmp/dfs/data

重新启动hadoop,jps后发现6个进程全部出现。



你可能感兴趣的:(ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: All directories in dfs.data.dir are invalid)