搜索
您的当前位置:首页正文

Hadoop 安全模式永久退出的方法

来源:榕意旅游网

在HDFS配置文件中修改安全模式阀值
在hdfs-site.xml中设置安全阀值属性,属性值默认为0.999f,如果设为1则不进行安全检查

<property>
  <name>dfs.safemode.threshold.pct</name>
  <value>0.999f</value>
  <description>
    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.
  </description>
</property>

把其中的0.999f改为 1f

<property>
  <name>dfs.safemode.threshold.pct</name>
  <value>1f</value>
  <description>
    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.
  </description>
</property>

这样更改配置文件,将会永久性解决hadoop安全模式启动的问题

2、直接在bash输入指令脱离安全模式(推荐)
在安全模式下输入指令:

hadoop dfsadmin -safemode leave

即可退出安全模式
这种退出方式是临时退出当次hadoop安全模式,在下一次进入hadoop时还是会启动安全模式

因篇幅问题不能全部显示,请点此查看更多更全内容

Top