Hadoop退出安全模式(Name node is in safe mode)

核心报错信息:

[root@lee000 mapreduce]# hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.15.1.jar pi 2 3
Number of Maps  = 2
Samples per Map = 3
20/01/01 23:42:06 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.SafeModeException): Cannot create directory /user/root/QuasiMonteCarlo_1577893326626_1903374892/in. Name node is in safe mode.

解决方案:

//"$HADOOP_HOME/bin":目录下执行
bin/hadoop dfsadmin -safemode leave

//环境变量已配则可以直接执行
hadoop dfsadmin -safemode leave

扩展:
通过hadoop dfsadmin -safemode value 来操作安全模式,参数value的说明如下:
enter - 进入安全模式
leave - 强制NameNode离开安全模式
get - 返回安全模式是否开启的信息
wait - 等待,一直到安全模式结束。

参考:https://blog.csdn.net/xw13106209/article/details/6866072

你可能感兴趣的:(Hadoop)