Can someone give me an correct approach on how to take the namenode metadata backup.
1. Taking snapshots of NN directory is enough
2.If I use this "hdfs dfsadmin -fetchImage someFilename " then how do I backup the editlogs.
3. I found this URL for HDFS backup
Please suggest me how to take the backup NameNode metadata.
Thanks in advance
I followed the give link and took backup like this. Please correct me if I miss anything
hdfs dfsadmin -rollEdits
hdfs dfsadmin -fetchImage data/hadoop/hdfs/namenode/current/fsimg_bkp
took copy of VERSION file
Follow as below
1) back-up the block location
sudo -u hdfs hdfs fsck / -files -blocks -locations > /data/backup2082016/dfs-old-fsck-1.log Connecting to namenode via http://hostname.name.com:50070/fsck?ugi=hdfs&files=1&blocks=1&locations=1&path=%2F
2)Put namenode in safemode
root@hostname[backup2082016] # sudo -u hdfs hdfs dfsadmin -fs hdfs://host.name.com:8020 -saveNamespace saveNamespace: Safe mode should be turned ON in order to create namespace image.
root@hostname[backup2082016] # sudo -u hdfs hdfs dfsadmin -safemode enter
Safe mode is ON in
root@hostname[backup2082016] # sudo -u hdfs hdfs dfsadmin -fs hdfs://host.name.com:8020 -saveNamespace Save namespace successful
3) Go Namenode storage directory and take the back of that file
NameNode directories= /data/hadoop/hdfs/namenode/
In Namenode Storage directory, take the back of current directory.
drwxr-xr-x 2 hdfs hadoop 36864 Nov 23 14:27 current
and Put nanenode back to normal mode.
root@hostname[backup2082016] # sudo -u hdfs hdfs dfsadmin -safemode leave
Thanks for the detailed backup process, I am able to backup as mentioned.
I wanted to know ho we restore the content which you are taking backup /data/backup2082016/dfs-old-fsck-1.log.
at the end this log file should be useful somewhere how are we making use of this log file?I can recover the current directory by creating same folder structure and place it there back but how about the dfs-old-fsck-1.log?
Please let me know.
Manjunath P N