Hadoop version: Hadoop 2.2.0.2.0.6.0-0009

Well, We can do this by building Secondary Namenode, Checkpoint node or Backup node.

Example:

Assuming you have a Secondary Namenode.

1. Check secondary namenode checkpoint status:

dfs.namenode.secondary.http-address in  %HADOOP_CONF_DIR%/hdfs-site.xml

fs.namenode.checkpoint.dir in  %HADOOP_CONF_DIR%/hdfs-site.xml

dfs.namenode.checkpoint.edits.dir in  %HADOOP_CONF_DIR%/hdfs-site.xml

dfs.namenode.checkpoint.period in  %HADOOP_CONF_DIR%/hdfs-site.xml

2. Backup your real time checkpoint by hand:

On Secondary namenode, Stop Hadoop secondary namenode service.

Run cmd.exe by user hadoop ( or some users have full permission )

[plain] view
plain
copy

  1. Runas /user:hadoop cmd.exe

You must have user hadoop password.

Backup real time checkpoint:

[plain] view
plain
copy

  1. cmd>%hadoop_home%/bin/hadoop secondarynamenode -checkpoint force

Start Hadoop secondary namenode service. and check secondary namenode checkpoint status ( see step 1)

3. Stop Namenode services or reboot Namenode ( if hadoop service set to booting manual ,the services would all stop after reboot )

As for test, I backup my dfs.namenode.name.dir (i.e C:\hdpdata\hdfs\nn)  first for my next test ( restore from my namenode dir backup ) .

Delete all files in C:\hdpdata\hdfs\nn ,

Open  dfs.namenode.checkpoint.dir (see %HADOOP_CONF_DIR%/hdfs-site.xml ) in secondary namenode (i.e. c:\hdpdata\hdfs\snn )

Copy all secondary checkpoint files( except the lock file) from this folder to your namenode's checkpoint dir (dfs.namenode.checkpoint.dir the same as secondary namenode)

Make sure namenode's checkpoint dir is empty already !

4.  Restore from checkpoint dir

Run cmd.exe by user hadoop ( or some users have full permission )

[plain] view
plain
copy

  1. Runas /user:hadoop cmd.exe

You must have user hadoop password.

Use this command to start hadoop service and import checkpoint from checkpoint dir

[plain] view
plain
copy

  1. cmd>%hadoop_home%/bin/hdfs namenode -importcheckpoint

Use ctrl+C to stop service which is completed. and Delete your namenode's checkpoint dir (dfs.namenode.checkpoint.dir the same as secondary namenode)

Start service by this command:

[plain] view
plain
copy

  1. cmd>start_local_hdp_services.cmd

Levae safemode

[plain] view
plain
copy

  1. cmd>%hadoop_home%/bin/hdfs dfsadmin -safemode leave

Balance you HDFS:

[plain] view
plain
copy

  1. cmd>%hadoop_home%/bin/hdfs balancer -threshold 5

5. Confirm your Hadoop service is restored successfully.

Open URL  http://namenode:50070/ to check if there are some missing block. If yes. Please kindly check where they are and what they are.

Because restore from secondary namenode isn't a real time restore solution. It may lost the last time what you do in the jobtracker. It doesn't matter. Just delete them.

Tips: If you want to restore a real time backup, please use multiplicate namenode dir mode. see next post... ...

Experience on Namenode backup and restore --- checkpoint的更多相关文章

  1. hadoop 2.5 hdfs namenode –format 出错Usage: java NameNode [-backup] |

    在 cd  /home/hadoop/hadoop-2.5.2/bin 下 执行的./hdfs namenode -format 报错[hadoop@node1 bin]$ ./hdfs nameno ...

  2. 【Hadoop】namenode与secondarynamenode的checkpoint合并元数据

    Checkpoint Node(检查点节点) NameNode persists its namespace using two files: fsimage, which is the latest ...

  3. TFS Express backup and restore

    When we setup source control server, we should always make a backup and restore plan for it. This ar ...

  4. 转:db2 backup 及 restore

    db2 backup 及 restore 2011-06-21 18:12:20|  分类: AIX |举报 |字号 订阅     两个问题: db2=>list applications db ...

  5. 第一章、关于SQL Server数据库的备份和还原(sp_addumpdevice、backup、Restore)

    在sql server数据库中,备份和还原都只能在服务器上进行,备份的数据文件在服务器上,还原的数据文件也只能在服务器上,当在非服务器的机器上启动sql server客户端的时候,也可以通过该客户端来 ...

  6. [转]Configure Network Drive Visible for SQL Server During Backup and Restore Using SSMS

    本文转自:https://mytechmantra.com/LearnSQLServer/Configure-Network-Drive-Visible-for-SQL-Server-During-B ...

  7. Backup and restore of FAST Search for SharePoint 2010

    一个同事问我一个问题: 如果FAST Search for SharePoint 2010被full restore到了一个之前的时间点, 那么当FAST Search重新开始一个增量爬网的时候, 会 ...

  8. SQL Server Database Backup and Restore in C#

    SQL Server Database Backup and Restore in C# Syed Noman Ali Shah,                          7 Feb 201 ...

  9. Backup and Restore MySQL Database using mysqlhotcopy

    mysqlhotcopy is a perl script that comes with MySQL installation. This locks the table, flush the ta ...

随机推荐

  1. SQL中关于where后面不能放聚合函数(如sum等)的解决办法

    我们在编写较为复杂的SQL语句的时候,常常会遇到需要将sum()放到where后面作为条件查询,事实证明这样是无法执行的,执行会报[此处不允许使用分组函数]异常. 那么如何解决呢,使用HAVING关键 ...

  2. System.Threading.Tasks并发和异步代码使用

    main.cs System.Threading.Tasks.Parallel.For(0, 10, i =>            {                TestLock test ...

  3. 数学图形(2.13)Spherical trochoid曲线

    该曲线与上一节的herical cycloid球面外摆曲线 很相似,难道这是球面内摆曲线? #http://www.mathcurve.com/courbes3d/cycloidspheric/tro ...

  4. GPGPU OpenCL 获取设备信息

    在使用OpenCL编程中,需要对GPU设备的底层理解,这样才能更好的进行代码优化. 比如计算单元CU数量,每个CU的执行单元PE数量,每个CU中的共享内存大小等等.只有了解了这些才能更好的使用共享内存 ...

  5. 【转】svn 的开发目录结构和流程

    原文: https://blog.csdn.net/iteye_15570/article/details/82548132 ------------------------------------- ...

  6. TortoiseSVN 源代码下载

    SVN的客户端软件TortoiseSVN http://tortoisesvn.tigris.org/ 这是我采用的 TortoiseSVN 的官方网站,页面上的两只小乌龟真的很好看. 目前最新的版本 ...

  7. [Compose] 19. Leapfrogging types with Traversable

    We use the traversable instance on List to reimplement Promise.all() type functionality. For example ...

  8. EJS快速入门

    文章来源:http://www.360doc.com/content/16/0115/10/597197_528136785.shtml Node 开源模板的选择很多,但推荐像我这样的老人去用 EJS ...

  9. 关于Csdn水区被占据一事 (2015-08-01)

    例如以下图所看到的 水区被占据 ,假设发贴机不仅仅在水区发贴.也在其他版块也发贴,将不堪设想啊各位. 如今非常多站点也经历过被 注冊机,发贴机,乱炸,是非常可恨的事.可是您想想.为什么注冊机.发贴机会 ...

  10. 19-spring学习-springMVC环境配置

    新建一共环境,添加spring支持,就可以开发springMVC了. 既然是springMVC,就必须为其定义相关配置. 1,springMVC所有配置都需要在applicationContext.x ...