`
lt200819
  • 浏览: 188102 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Hadoop 解除 "Name node is in safe mode"

 
阅读更多
之前在hadoop执行过程中使用了"ctrl+c"操作
再次使用hadoop时出现“Name node is in safe mode”提示:
root@v-jiwan-ubuntu-0:~/hadoop/hadoop-0.20.2# bin/hadoop fs -put conf input
put: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/root/input/conf. Name node is in safe mode.

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

最近在測試hadoop,但是沒想到在reduce時卡點,
沒辦法只好Ctrl+c,但是問題也就跟著來了XD
先將hadoop停止後,再啟動hadoop
然後要刪除DFS裡的資料時,
就出現name node is in safe mode,就沒辦法刪除資料啦!
找了好久才找到答案,

bin/hadoop dfsadmin -safemode leave
就可以把safemode解除,為了這個問題煩惱了好久Orz
-----------------------------
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 - 等待,一直到安全模式结束。Hadoop 解除 "Name node is in safe mode"
分享到:
评论

相关推荐

    Config and Run Hadoop Single Node mode in Ubuntu linux

    $ sudo adduser --ingroup hadoop hadoop ``` 3. **设置 Hadoop 用户的 sudo 权限**:编辑 `/etc/sudoers` 文件,为 `hadoop` 用户分配 sudo 权限。 - 使用文本编辑器(如 `vi`)打开 `/etc/sudoers` 文件。 ``...

    Config and Run Hadoop Multiple Node mode in Ubuntu linux

    配置和运行hadoop,以multi node方式在ununtu linux 上。

    Hadoop硬实战:Hadoop in Practice

    Hadoop硬实战:Hadoop in Practice

    Hadoop Multi Node Cluster 安装步骤.pdf

    Hadoop Multi Node Cluster 安装步骤.pdf

    Hadoop Single Node Cluster的安装.txt

    Hadoop Single Node Cluster的详细安装,master主机与data1、data2、data3三台节点连接。

    hadoop single node setup

    根据给定的文件信息,以下是对“hadoop single node setup”相关知识点的详细说明: 1. Hadoop单节点安装的目的 Hadoop单节点安装的主要目的是为了让用户能够在单机上快速地进行简单的Hadoop MapReduce和Hadoop...

    Hadoop in Action

    HIGHLIGHT Hadoop in Action is an example-rich tutorial that shows developers how to implement data-intensive distributed computing using Hadoop and the Map- Reduce framework. DESCRIPTION Hadoop is an ...

    Hadoop In Action2

    Hadoop In Action 中文第二版 卷二 rar

    Hadoop_in_Action

    PART 2 - Hadoop in Action CHAPTER 4 Writing basic MapReduce programs CHAPTER 5 Advanced MapReduce CHAPTER 6 Programming practices CHAPTER 7 Cookbook CHAPTER 8 Managing Hadoop PART 3 - Hadoop Gone Wild...

    Hadoop权威指南中文版(第二版)+Hadoop in Action

    《Hadoop权威指南中文版(第二版)》与《Hadoop in Action》及《Pro Hadoop》这三本书是深入理解和掌握Hadoop生态系统的关键资源。Hadoop作为一个分布式计算框架,其核心是解决大规模数据处理的问题,它允许在廉价...

    Hadoop in action中文版.pdf

    从个人经历看,学习这些技术...幸好我发现了Manning出版社的In Action系列 丛书,它们正与此目标相吻合,而且出版社有一群优秀的编辑帮助我达成目标。 我非常享受写作这本书的时光,希望它能为你开启畅游Hadoop的旅途。

    Hadoop使用常见问题以及解决方法

    Namenode in safe mode 是 Hadoop 中的常见问题,主要是由于 Namenode 进入安全模式。解决方法是使用 `bin/hadoop dfsadmin -safemode leave` 命令离开安全模式。 java.net.NoRouteToHostException: No route to ...

    Hadoop in Practice

    Hadoop in Practice collects 85 Hadoop examples and presents them in a problem/solution format. Each technique addresses a specific task you'll face,

    Sams Teach Yourself Hadoop in 24 Hours epub

    Sams Teach Yourself Hadoop in 24 Hours 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

Global site tag (gtag.js) - Google Analytics