Backing Up HDFS Metadata

Note:
Cloudera recommends backing up HDFS metadata regularly, and before major upgrades.
Before backing up, stop the cluster. It is very important that the NameNode role process is not running so you can have consistent backups.

Stop the NameNode to be backed up.
Go to HDFS service.
Select Configure > View and Edit.
In the search field, search for "NameNode data directory". This finds the NameNode data directory properties.
Back up the directories listed in the NameNode Data Directories property from the command line on the NameNode host. If multiple directories are listed, only one directory needs to be backed up because each directory is a complete copy. For example, if the data directory is /mnt/hadoop/hdfs/name, do the following as root:

# cd /mnt/hadoop/hdfs/name
# tar -cvf /root/nn_backup_data.tar.

You should see output like this:

./
./current/
./current/fsimage
./current/fstime
./current/VERSION
./current/edits
./image/
./image/fsimage

Warning: If you see a file containing word locks, the NameNode may still be running. Repeat the above steps, first close the CDH service.

References:

http://www.cloudera.com/documentation/manager/5-0-x/Cloudera-Manager-Managing-Clusters/cm5mc_hdfs_metadata_backup.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325382448&siteId=291194637