当前位置:网站首页>NameNode故障处理的两种方法
NameNode故障处理的两种方法
2022-07-31 12:21:00 【巴涅波赫夫】
NameNode故障后,可以采用两种方法恢复数据。
方法一:将 SecondaryNameNode 中数据拷贝到 NameNode 存储数据的目录
- kill -9 NameNode 进程
- 删除 NameNode 存储的数据(/opt/module/hadoop-3.1.3/data/tmp/dfs/name)
rm -rf /opt/module/hadoop-3.1.3/data/dfs/name/*
- 拷贝 SecondaryNameNode 中数据到原 NameNode 存储数据目录
scp -r [email protected]:/opt/module/hadoop-3.1.3/data/dfs/namesecondary/* ./nam
e/
- 重新启动 NameNode
[[email protected] hadoop-3.1.3]$ hdfs --daemon start namenode
方法二:使用-importCheckpoint 选项启动 NameNode 守护进程,从而将 SecondaryNameNode中数据拷贝到 NameNode 目录中
- 修改 hdfs-site.xml 中的
<property>
<name>dfs.namenode.checkpoint.period</name>
<value>120</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/opt/module/hadoop-3.1.3/data/dfs/name</value>
</property>
- kill -9 NameNode 进程
- 删除 NameNode 存储的数据(/opt/module/hadoop-3.1.3/data/dfs/name)
rm -rf /opt/module/hadoop-3.1.3/data/dfs/name/*
- 如 果 SecondaryNameNode 不 和 NameNode 在 一 个 主 机 节 点 上 , 需 要 将SecondaryNameNode 存储数据的目录拷贝到 NameNode 存储数据的平级目录,并删除in_use.lock 文件
[[email protected] dfs]$ scp -r [email protected]:/opt/module/hadoop-3.1.3/data/dfs/namesecondary ./
[[email protected] namesecondary]$ rm -rf in_use.lock
[[email protected] dfs]$ pwd
/opt/module/hadoop-3.1.3/data/dfs
[[email protected] dfs]$ ls
data name namesecondary
- 导入检查点数据(等待一会 ctrl+c 结束掉)
[[email protected] hadoop-3.1.3]$ bin/hdfs namenode -importCheckpoint
- 启动 NameNode
[[email protected] hadoop-3.1.3]$ hdfs --daemon start namenode
边栏推荐
- 基于生物激励神经网络的室内实时激光SLAM控制方法
- Basic use of dosbox [easy to understand]
- Getting started with jmeter performance testing steps (performance testing tool jmeter)
- 深度学习基本概念
- 订song餐系统
- The 2nd activity of the TOGAF10 Standard Reading Club continues wonderfully, and the highlights will be reviewed!
- 0x80070570 The file or directory is damaged and cannot be deleted (how to delete 0x80070091)
- 第十二章 使用中的 OpenAPI 属性
- 荣耀手机参数写错,客服认为没错
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
猜你喜欢
随机推荐
MySQL模糊查询性能优化
ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
在 Excel 内使用 ODBC 消费 SAP ABAP CDS view
PAT考试总结(考试心得)
chroot命令
Docker practical experience: Deploy mysql8 master-slave replication on Docker
The 2nd activity of the TOGAF10 Standard Reading Club continues wonderfully, and the highlights will be reviewed!
Chrome开发自定义右键菜单实现快速跳转到指定页面
file contains vulnerabilities
普林斯顿微积分读本03第二章--编程实现函数图像绘制、三角学回顾
Exploring Plain Vision Transformer Backbones for Object Detection Paper Reading Notes
A Week of Wonderful Content Sharing (Issue 14)
Qt鼠标穿透
一文吃透哈希表
手撕Verilog PWM呼吸灯
Spark GC日志分析
SAP Commerce Cloud Product Review 的添加逻辑
How does the SAP ABAP OData service support the $filter (filter) operation trial version
SAP ABAP OData 服务如何支持 $filter (过滤)操作试读版
Acwing第 62 场周赛【未完结】









