Hadoop运行中遇到的错误调试
在运行Hadoop的过程中遇到的最多的问题就是DataNode不能正常的启动,各种问题都有可能,说一下我遇到的两种情况:
(1)第一种情况是Master的防火墙没有关闭。这样在启动Hadoop的时候,Master这个节点可以正常的启动,但是Master的防火墙开启以后,使得Slave不能访问Master的9000端口。这种情况,在Slave的DataNode启动后又立即关闭了。
(2)第二种情况的原因:每次NameNode -format会重新创建一个NameNode ID,而tmp/dfs/data/current下的文件VERSION中包含了上次format下的ID,NameNode -format清空了NameNode下的数据,但是没有清空DataNode下的数据,导致启动时失败。所要做的就是每次fotmat前,清空tmp一下的所有目录。
在说完上面的两个问题之后,说一个怎么强调都不过分的东西,那就是要学会看运行的日志信息。上面的两个问题都会在日志中有显示。
哪个节点没有启动,就查哪个节点的logs文件夹下的日志信息。以第二个问题为例,DataNode没有启动就能看到那个结点的日志信息:
-- ::, ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Incompatible namespaceIDs in /home/admin/joe.wangh/hadoop/data/dfs.data.dir: namenode namespaceID = ; datanode namespaceID =
at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:)
at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:)
at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:)
at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:)
at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:)
at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:)
at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:)
错误提示namespaceIDs不一致。
找到错误的原因之后,才能对症下药,找到解决问题的办法:
下面给出两种解决办法,我使用的是第二种。
Workaround 1: Start from scratch
I can testify that the following steps solve this error, but the side effects won't make you happy (me neither). The crude workaround I have found is to:
1. stop the cluster
2. delete the data directory on the problematic datanode: the directory is specified by dfs.data.dir in conf/hdfs-site.xml; if you followed this tutorial, the relevant directory is /usr/local/hadoop-datastore/hadoop-hadoop/dfs/data
3. reformat the namenode (NOTE: all HDFS data is lost during this process!)
4. restart the cluster
When deleting all the HDFS data and starting from scratch does not sound like a good idea (it might be ok during the initial setup/testing), you might give the second approach a try.
Workaround 2: Updating namespaceID of problematic datanodes
Big thanks to Jared Stehler for the following suggestion. I have not tested it myself yet, but feel free to try it out and send me your feedback. This workaround is "minimally invasive" as you only have to edit one file on the problematic datanodes:
1. stop the datanode
2. edit the value of namespaceID in <dfs.data.dir>/current/VERSION to match the value of the current namenode
3. restart the datanode
If you followed the instructions in my tutorials, the full path of the relevant file is /usr/local/hadoop-datastore/hadoop-hadoop/dfs/data/current/VERSION (background: dfs.data.dir is by default set to ${hadoop.tmp.dir}/dfs/data, and we set hadoop.tmp.dir to /usr/local/hadoop-datastore/hadoop-hadoop).
If you wonder how the contents of VERSION look like, here's one of mine:
#contents of <dfs.data.dir>/current/VERSION
namespaceID=393514426
storageID=DS-1706792599-10.10.10.1-50010-1204306713481
cTime=1215607609074
storageType=DATA_NODE
layoutVersion=-13
Hadoop运行中遇到的错误调试的更多相关文章
- hadoop过程中遇到的错误与解决方法
本文整理了在hadoop学习过程中遇到的各种问题. windows下开发环境搭建 大部分情况下,我们都是在windows下开发,hadoop则一般部署于linux服务器(无论是CDH还是原生hadoo ...
- php代码中临时开启错误调试
对php.ini 中参数的设置 也可用在php代码中完成. 调用:调用ini_set()函数 //开启php.ini中的display_errors指令 ini_set('display_errors ...
- .net 运行中出现的错误解决方法记录
1.应用程序无法启动,因为应用程序的并行配置不正确.有关详细信息,请参阅应用程序事件日志,或使用命令行sxstrace.exe工具. https://jingyan.baidu.com/article ...
- ejabberd 在eclipse(erlide)中的配置、调试、运行
最近在折腾ejabberd,将ejabberd项目配置到eclipse中进行编译.调试等,现在将过程记下来,希望能帮助到需要的人. 准备 本次环境是在linux中进行,博主的linux是fedora2 ...
- hadoop安装过程中出现的错误
此次来记录一下我在安装Hadoop安装过程中出现的错误,安装过程参照慕课网林子雨教程进行安装,在尝试过程中出现的错误如下: 1.在安装Ubuntu时,新建虚拟电脑时,并没有在版本的输入框中有Ubunt ...
- gdb调试已在运行中的进程
一.在服务器上调试进程,服务器上并没有源代码,所以需要将源码上传至服务器,才能调试看到源码,以下是步骤: 1.查看服务进程id:pgrep 服务名 [user@user-MP app]$ pgrep ...
- 从零自学Hadoop(12):Hadoop命令中
阅读目录 序 HDFS Commands User Commands Administration Commands Debug Commands 引用 系列索引 本文版权归mephisto和博客园共 ...
- 【转】段错误调试神器 - Core Dump详解
from:http://www.embeddedlinux.org.cn/html/jishuzixun/201307/08-2594.html 段错误调试神器 - Core Dump详解 来源:互联 ...
- hadoop运行流程分析源代码级
前言: 最近一直在分析hadoop的运行流程,我们查阅了大量的资料,虽然从感性上对这个流程有了一个认识但是我总是感觉对mapreduce的运行还是没有一个全面的认识,所以决定从源代码级别对mapred ...
随机推荐
- aliyun opts 集锦
<一,>,aliyun 使用数据盘(aliyun新增数据盘使用,创建vg,aliyun 镜像系统本身未使用lvm-vg-lv) 1.1直接挂载文件系统 较易,不做分析 http://hel ...
- oracle decode函数用法
DECODE函数是ORACLE PL/SQL是功能强大的函数之中的一个,眼下还仅仅有ORACLE公司的SQL提供了此函数,其它数据库厂商的SQL实现还没有此功能.DECODE有什么用途 呢? 先构造一 ...
- Nothing2
重压下似乎找不到释放的出口. 拳套早已封存, 竹箫也非常久不去碰它, 如今预计已然吹不出心弦之曲, 围棋的造诣也退步到家了. 是不是仅仅有当思路电光石火, 当指尖快如闪电, 当键盘上舞动的手指跟上思想 ...
- 为客户打造RAC-DG一些遇到的问题汇总
昨日有建立一个客户RAC-DG物理备用数据库,这里的一般过程中再次列举一下,为了不涉及泄露隐私.的主要参数已被替换名称.详细路径也不一致.因为环境的客户端不与本机连接的网络同意,当故障不能削减各种报警 ...
- OpenStack里的浮动ip
缺省情况下实例会被赋予固定ip,这时并不能保证实例会马上可以从外面访问到,一般来说需要配置防火墙来允许公共ip,然后建立一条NAT规则从公共ip到私有ip的映射.OpenStack引入了一个叫浮动ip ...
- 解决 Tomcat reload WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but fail
转自:http://www.cnblogs.com/interdrp/p/5632529.html 我的错误如下: 06-Sep-2016 18:57:10.595 WARNING [localhos ...
- c语言中的字符数组与字符串
1.字符数组的定义与初始化 字符数组的初始化,最容易理解的方式就是逐个字符赋给数组中各元素. char str[10]={ 'I',' ','a','m',' ',‘h’,'a','p','p','y ...
- servlet同一用户的不同页面共享数据
一.cookie技术 cookie的讲解和使用 --------------- 服务器在客户端保存用户的信息,比如登录名,密码等...就是cookie, 服务器端在需要时可以从客户端读取. cooki ...
- @Transactional失效的问题
spring事物配置一般没有问题, 优先检查mysql的引擎是否是innodb, 是的话检查包的扫描是否有问题. 我就是因为包的扫描导致@Transactional失效. 具体情况如下, 在sprin ...
- Linux下nc命来实现文件传输
发送端:cat test.txt | nc -l -p 6666或者nc -l -p 6666 < test.txt 有些版本不要在 -p[监听6666端口,等待连接](设发送端IP为10.20 ...