posts - 495,comments - 227,trackbacks - 0
          http://39382728.blog.163.com/blog/static/35360069201182710565420/

          運行hadoop程序時, 中途我把它終止了,然后再向hdfs加文件或刪除文件時,出現Name node is in safe mode錯誤:
          rmr: org.apache.hadoop.dfs.SafeModeException: Cannot delete /user/hadoop/input. Name node is in safe mode

          解決的命令:

          bin/hadoop dfsadmin -safemode leave #關閉safe mode


          轉自: http://shutiao2008.iteye.com/blog/318950

           

          附 安全模式 學習:

          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 - 等待,一直到安全模式結束。
          posted on 2013-03-28 16:55 SIMONE 閱讀(735) 評論(0)  編輯  收藏 所屬分類: hbase
          主站蜘蛛池模板: 边坝县| 奇台县| 乐至县| 读书| 桓台县| 梅州市| 连南| 陆川县| 稻城县| 资溪县| 谢通门县| 花垣县| 临泽县| 军事| 香河县| 台南县| 宣武区| 日土县| 开平市| 临高县| 射洪县| 石台县| 洪洞县| 玉田县| 蓬安县| 达拉特旗| 苏尼特左旗| 江都市| 营口市| 兴宁市| 容城县| 海南省| 阜南县| 水城县| 固安县| 永丰县| 临邑县| 清远市| 景泰县| 天津市| 兴化市|