在HDFS配置文件中修改安全模式阀值
在hdfs-site.xml中设置安全阀值属性,属性值默认为0.999f,如果设为1则不进行安全检查
dfs.safemode.threshold.pct 0.999f Specifies the percentage of blocks that should satisfy the minimal replication requirement defined by dfs.replication.min. Values less than or equal to 0 mean not to wait for any particular percentage of blocks before exiting safemode. Values greater than 1 will make safe mode permanent.
把其中的0.999f改为 1f
dfs.safemode.threshold.pct 1f Specifies the percentage of blocks that should satisfy the minimal replication requirement defined by dfs.replication.min. Values less than or equal to 0 mean not to wait for any particular percentage of blocks before exiting safemode. Values greater than 1 will make safe mode permanent.
这样更改配置文件,将会永久性解决hadoop安全模式启动的问题
2、直接在bash输入指令脱离安全模式(推荐)
在安全模式下输入指令:
hadoop dfsadmin -safemode leave
即可退出安全模式
这种退出方式是临时退出当次hadoop安全模式,在下一次进入hadoop时还是会启动安全模式



