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. IIS服务器支持.apk文件下载

    随着智能手机的普及,越来越多的人使用手机上网,很多网站也应手机上网的需要推出了网站客户端,.apk文件就是安卓(Android)的应用程序后缀名,默认情况下,使用IIS作为Web服务器的无法下载此文件 ...

  2. C# 将Dictionary,StringDictionary等集合数据绑定到如comboBox等控件数据源中将获取健值

    一般在使用C#提供的如combobx控件绑定数据源时都是直接绑定数据库里的数据的(DataTable,DataSet等) 最近在一个项目里需要使用combobox绑定类似“状态的”数据源,该字段里的数 ...

  3. PHP免费的空间www.hostinger.co.uk

    免费的PHP空间:http://hostinger.co.uk hostinger是一个免费的PHP空间,不仅100%完全免费而且还没有广告,提供2G物理空间和100GMysql空间 可以一键安装Wo ...

  4. C#基础视频教程7.1 如何编写简单游戏

    要做一个FlappyBird,最核心的功能是创建几个区块,如果发生碰撞则游戏结束(小鸟撞到管子上,或者小鸟到地上),至于随机生成一些管子,小鸟如何跳跃,最后如何统计分数,都不难想通要怎么做.   首先 ...

  5. Objective-C中3种枚举比较及KVC两个小技巧

    Objective-C中3种枚举比较及KVO两个小技巧 一:oc的3种枚举 for循环 for in 枚举块 如代码 NSUInteger totalCount = 10000; NSMutableA ...

  6. PHP 杂项函数

    PHP 杂项 函数 PHP 杂项函数简介 我们把不属于其他类别的函数归纳到杂项函数类别. 安装 杂项函数是 PHP 核心的组成部分.无需安装即可使用这些函数. Runtime 配置 杂项函数的行为受 ...

  7. 阿里云服务器 centos7 ftp安装

    昨天租了阿里云服务器一个月,想玩一下linux系统,结果想用ftp上传本地文件的时候,发现用不了,结果在安装配置的时候折腾了几个小时,在网上查了无数的资料,有的说要改配置文件,有的说要关防火墙,说啥的 ...

  8. Js 的test方法

    Js 的test()方法 test() 方法用于检测一个字符串是否匹配某个模式. 定义和用法test() 方法用于检测一个字符串是否匹配某个模式. 如果字符串中有匹配的值返回 true ,否则返回 f ...

  9. Java计算机硬盘大小转换(B,KB,MB,GB,TB,PB之间的大小转换)

    程序员都很懒,你懂的! java程序员在实际的开发中会遇到很多的单位换算问题.今天我给大家带来的是关于计算机硬盘大小的换算.多数情况下,一般要求 b,kb,mb,gb,tb,pb之间的大小转换,我们都 ...

  10. async [ə'zɪŋk] 函数

    ES7提供了async函数,使得异步操作变得更加方便.async函数是什么?一句话,async函数就是Generator函数的语法糖. 例1: var asyncFun = async functio ...