1、问题描述
在/xxx/install/hadoop-2.6.0-cdh5.14.2/share/hadoop/mapreduce/
试运行Hadoop例子时hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.14.2.jar pi 5 5
,出现安全模式问题
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.SafeModeException): Cannot delete /tmp/hadoop-yarn/staging/hadoop/.staging/job_1490689337938_0001. Name node is in safe mode.
2、解决方法
使用下面命令,退出安全模式
hadoop dfsadmin -safemode leave
要安全模式,可以使用
hadoop dfsadmin -safemode enter
重新运行案例,当得到结果3.68,即证明集群可以使用。