[Todo] simulate namenode crash and restore

Source: Internet
Author: User

Todo: There is something unclear.


1. Configure the namenode checkpoint for ease of demonstration. For more information, see How often namenode checkpoints occur.

2. Start hadoop to ensure that all nodes are normal.

3. Delete all content in the DFS. Name. dir specified directory (that is, the name directory) on the namenode node to simulate a fault.

4. Disable hadoop and check JPs. The namenode is not started successfully.

    • View the namenode logs in the $ hadooop_home/logs/directory of the namenode node and find the exception: Java. Io. ioexception: namenode is not formated.

    • At the same time, check the Directory and file status on HDFS. If LS is used, an error is reported.

5. Disable hadoop and format namenode again.

6. Enter the namenode NodeUpperDFS. Name. dir specifies the directory (that is, the name directory), and a new content has been generated. Edit the version in current. Change the namespaceid value to the namespaceid (the original value) in any datanode in the cluster)

7. Delete the newly generated fsimage

8. Copy the fsimage of secondarynamenode.

Note: I copied the files in the namesecondary/image/directory. Some information on the internet says yesNamesecondary/But there is no content in my current.

9. Start hadoop

10. After the instance is started, everything is normal.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.