Incompatible namespaceIDs或连接被对端重置异常的解决

简介: <p align="left"><strong>Workaround 1: Start from scratch</strong></p> <p align="left">I can testify that the following steps solve this error, but the side effects won't make you happy (me neithe

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

 

原因:每次namenode format会重新创建一个namenodeId,而tmp/dfs/data下包含了上次format下的id,namenode format清空了namenode下的数据,但是没有晴空datanode下的数据,导致启动时失败,所要做的就是每次fotmat前,清空tmp一下 的所有目录.

目录
相关文章
|
11月前
|
编译器 C语言 C++
【c++丨STL】list模拟实现(附源码)
本文介绍了如何模拟实现C++中的`list`容器。`list`底层采用双向带头循环链表结构,相较于`vector`和`string`更为复杂。文章首先回顾了`list`的基本结构和常用接口,然后详细讲解了节点、迭代器及容器的实现过程。 最终,通过这些步骤,我们成功模拟实现了`list`容器的功能。文章最后提供了完整的代码实现,并简要总结了实现过程中的关键点。 如果你对双向链表或`list`的底层实现感兴趣,建议先掌握相关基础知识后再阅读本文,以便更好地理解内容。
247 1
|
11月前
|
机器学习/深度学习 人工智能 自然语言处理
师资研修|AI技术赋能教材建设和课程开发——乌鲁木齐某教育部门
近日,TsingtaoAI派出AI专家为乌鲁木齐中职院校的教师团队,举办“AI技术赋能教材建设与课程开发”的师资研修。此次培训由TsingtaoAI的AI专家高寒和教育专家刘建老师亲自授课,面对的是来自乌鲁木齐的教育工作者,特别是中职院校的教学骨干。整个活动不仅涉及人工智能技术本身的深度解析,还深入探讨了如何将这些前沿技术高效应用于教材和课程体系的创新。
333 0
|
机器学习/深度学习 人工智能 监控
利用人工智能审查代码:提升代码质量和安全性
【10月更文挑战第15天】本文探讨了AI在代码审查中的应用,介绍了AI辅助代码审查工具如何通过机器学习算法提升代码质量、检测潜在错误,并促进团队知识共享。文中还详细说明了实施AI辅助代码审查的步骤及其实战技巧,强调了结合人工审查、定制化模型和持续监控的重要性。
|
SQL 存储 缓存
SQL计算班级语文平均分:详细步骤与技巧
在数据库管理和分析中,经常需要计算某个班级在特定科目上的平均分
|
网络协议 算法
RPC为何比较高效?
RPC为何比较高效?
233 0
|
Web App开发 安全 前端开发
个人关于使用阿里云在云端插件的体验
作为一个前端开发者,关于浏览器的使用是非常频繁的事情,相对于程序开发人员也是如此,毕竟浏览器使用是开发中必用的工具。在开发中,谷歌的Chrome浏览器是一款非常受欢迎的开发工具,基于谷歌的Chrome浏览器的插件也有很多,那么本文就来分享一下使用体验阿里云开发者研发了一款Chrome浏览器美化插件——在云端,它的功能是为用户提供更加舒适的浏览体验。作为一个使用该插件的用户,我想在这里分享一下我的使用心得。
456 0
个人关于使用阿里云在云端插件的体验
|
人机交互 芯片
西门子S7-200 SMART的功能和特点
西门子S7-200 SMART是西门子公司针对中国小型自动化市场客户需求设计研发的一款高性价比小型PLC产品。S7-200 SMART CPU将微处理器、集成电源、输入输出电路组合到一个设计紧凑的外壳中,已形成功能强大的小型plc。面板包含电源接线端子、直流24V电源输出端子、数字量输入输出接线端子、CPU状态指示灯、IO状态指示灯、存储卡插槽、以太网接口、RS485接口等。
西门子S7-200 SMART的功能和特点
|
存储 安全 大数据
什么是企业上云?企业上云有什么好处?
企业上云还是选择传统IDC?企业上云是趋势,公司业务数据中心迁移上云具有多重优势,云计算交付时间效率、价格成本、技术、安全性、数据可靠性等方面有着重大优势
1257 0
什么是企业上云?企业上云有什么好处?
计算机的时钟信号是干什么的?底层原理是什么?
计算机的时钟信号是干什么的?底层原理是什么?
932 0
|
前端开发 JavaScript 关系型数据库
基于Vue+Nodejs实现宿舍管理系统
考虑到实用性,该系统需要拆分为两大子系统,一个是学生端系统,一个是后台管理端系统。学生端系统主要提供给学生使用,负责一些宿舍记录及个人信息记录的基本操作;后台管理模块则是主要负责对所有学生信息的整理,提供宿舍管理、楼层管理、数据查看等权限,提供给宿舍管理员使用的。
535 0
基于Vue+Nodejs实现宿舍管理系统