Scenario
NameNode data needs to be recovered in the following scenarios: data is modified or deleted unexpectedly and needs to be restored. After an administrator performs critical data adjustment in NameNode, an exception occurs or the operation has not achieved the expected result. All modules are faulty and become unavailable. Data is migrated to a new cluster.
System administrators can create a recovery task in FusionInsight Manager to recover NameNode data. Only manual restoration tasks are supported.
Impact on the System
- After the data is restored, the data generated after the data backup and before the data restoration is lost.
- After the data is recovered, the NameNode needs to be restarted and is unavailable during the restart.
- After data is restored, metadata and service data may not be matched, the HDFS enters the security mode, and the HDFS service fails to be started. .
Prerequisites
- If you need to restore data from a remote HDFS, prepare a standby cluster. If the active cluster is deployed in security mode and the active and standby clusters are not managed by the same FusionInsight Manager, mutual trust has been configured. For details, see Configuring Cross-Manager Mutual Trust Between Clusters. If the active cluster is deployed in normal mode, no mutual trust is required.
- Cross-cluster replication has been configured for the active and standby clusters. For details, see Enabling Cross-Cluster Replication.
- Time is consistent between the active and standby clusters and the NTP services on the active and standby clusters use the same time source.
- You have logged in to FusionInsight Manager. For details, see Logging In to FusionInsight Manager.
- On FusionInsight Manager, all the NameNode role instances whose data is to be recovered are stopped. Other HDFS role instances must keep running. After data is recovered, the NameNode role instances need to be restarted. The NameNode role instances cannot be accessed during the restart.
- The NameNode backup files are stored Data path/LocalBackup/ on the active management node.
Procedure
- On FusionInsight Manager, click Cluster, click the name of the desired cluster, and choose Services > HDFS. On the displayed page, click Instance and click NameNode to check whether the NameNode instances of the data to be restored are stopped. If the NameNode instances are not stopped, stop them.
- On FusionInsight Manager, choose O&M > Backup and Restoration > Backup Management.
- In the Operation column of a specified task in the task list, choose More > View History to view historical backup task execution records.
In the displayed window, locate a specified success record and click View in the Backup Path column to view the backup path information of the task and find the following information:
- On FusionInsight Manager, choose O&M > Backup and Restoration > Restoration Management.
- Click Create.
- Set Task Name to the name of the restoration task.
- Select the cluster to be operated from Recovery Object.
- In the Restoration Configuration area, select NameNode.
- Set Path Type of NameNode to a backup directory type.
The settings vary according to backup directory types:
- Click OK.
- In the restoration task list, locate a created task and click Start in the Operation column to execute the restoration task.
- After the restoration is successful, the progress bar is in green.
- After the restoration is successful, the restoration task cannot be executed again.
- If the restoration task fails during the first execution, rectify the fault and click Retry to execute the task again.
- On FusionInsight Manager, click Cluster, click the name of the desired cluster, and choose Services > HDFS. On the displayed page, click Configurations and click All Configurations.
On the displayed page, enter the password of the administrator who has logged in for authentication and click OK. After the system displays "Operation succeeded", click Finish. The service is started successfully.