zoukankan      html  css  js  c++  java
  • hadoop 解除 "Name node is in safe mode"

    解决的命令:

    hadoop dfsadmin -safemode leave #关闭safe mode

    safemode模式

    NameNode在启动的时候首先进入安全模式,如果datanode丢失的block达到一定的比例(1-dfs.safemode.threshold.pct),则系统会一直处于安全模式状态即只读状态

    dfs.safemode.threshold.pct(缺省值0.999f)表示HDFS启动的时候,如果DataNode上报的block个数达到了元数据记录的block个数的0.999倍才可以离开安全模式,否则一直是这种只读模式。如果设为1则HDFS永远是处于SafeMode。

    下面这行摘录自NameNode启动时的日志(block上报比例1达到了阀值0.9990)

    The ratio of reported blocks 1.0000 has reached the threshold 0.9990. Safe mode will be turned off automatically in 18 seconds.

    hadoop dfsadmin -safemode leave

    有两个方法离开这种安全模式

    1. 修改dfs.safemode.threshold.pct为一个比较小的值,缺省是0.999。

    2. hadoop dfsadmin -safemode leave命令强制离开

    http://bbs.hadoopor.com/viewthread.php?tid=61&extra=page%3D1

    -----------------------------

    Safe mode is exited when the minimal replication condition is reached, plus an extension

    time of 30 seconds. The minimal replication condition is when 99.9% of the blocks in

    the whole filesystem meet their minimum replication level (which defaults to one, and

    is set by dfs.replication.min).

    安全模式的退出前提 - 整个文件系统中的99.9%(默认是99.9%,可以通过dfs.safemode.threshold.pct设置)的Blocks达到最小备份级别(默认是1,可以通过dfs.replication.min设置)。

    dfs.safemode.threshold.pct      float       0.999 

    The proportion of blocks in the system that must meet the minimum

    replication level defined by dfs.rep lication.min before the namenode

    will exit safe mode. Setting

    this value to 0 or less forces the name-node not to start in safe mode.

    Setting this value to more than 1 means the namenode never exits safe

    mode.

    -----------------------------

    用户可以通过dfsadmin -safemode value  来操作安全模式,参数value的说明如下:

    enter - 进入安全模式

    leave - 强制NameNode离开安全模式

    get -  返回安全模式是否开启的信息

    wait - 等待,一直到安全模式结束。

    化缘的改叫众筹了,算命的改叫分析师了,八卦小报改叫自媒体了,统计改叫大数据分析了,忽悠改叫互联网思维了,做耳机的改为可穿戴设备了,IDC 的都自称云计算了,办公室出租改叫孵化器了,圈地盖楼改叫科技园区了,借钱给朋友改叫天使投资了,放高利贷都改叫资本运作了 “互联网思维”这个词,就跟“小姐”一样,被大家用烂了。
  • 相关阅读:
    Linux Shell编程(3)——运行shell脚本
    Linux Shell编程(2)——第一个shell程序
    Linux Shell编程(1)——shell编程简介
    做“程序员”,不做“码农”,有哪些好办法?
    玩转大数据,顺利渡过34岁裁退危机!
    Google IO 2017为我们带来了什么
    《经验之谈》想要做好SEO推广必知要事,峰任策划告诉您。
    5月17日云栖精选夜读:分布式大数据系统巧实现,全局数据调度管理不再难
    程序员转型发展:拆除这些墙,才会发现更蓝的天空
    敢问路在何方?程序员转行应该卖水果还是卖烧饼
  • 原文地址:https://www.cnblogs.com/laodao/p/4484971.html
Copyright © 2011-2022 走看看