Restoring HDFS NameNode Metadata
Scenarios
NameNode data restoration is required in the following scenarios: when data is unexpectedly modified or deleted and requires retrieval; when major NameNode operations (such as upgrades or significant adjustments) cause exceptions in system data or fail to achieve the expected result; when all modules fail and become unavailable; and when data is migrated to a new cluster.
NameNode metadata restoration tasks can be created on FusionInsight Manager. The system supports manual data restoration only.
MRS clusters support multiple data path types for restoring NameNode metadata.
- LocalDir: indicates that data is restored from the local disk of the active management node.
- RemoteHDFS: indicates that data is restored from the HDFS directory of the standby cluster.
- NFS: indicates that data is restored from the NAS using the NFS protocol.
- CIFS: indicates that data is restored from the NAS using the CIFS protocol.
- SFTP: indicates that data is restored from the server using the SFTP protocol.
- OBS: indicates that data is restored from OBS.
- To restore data when the service is running properly, it is recommended that you manually back up the latest management data before performing data restoration. Otherwise, the NameNode data that is generated after the data backup and before the data recovery will be lost.
- It is recommended that each data restoration task restore the metadata of only one component to avoid affecting the restoration of other components when a service or instance is stopped. If data of multiple components is restored at the same time, data restoration may fail.
Notes and Constraints
- Data restoration can be performed only when the system version is consistent with the version used during data backup.
- HBase metadata cannot be restored concurrently with NameNode metadata. Attempting both at once will cause restoration to fail.
- MRS 3.1.0 and later support data restoration from OBS.
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, the metadata and service data may become mismatched, causing HDFS to enter safe mode and preventing the HDFS service from starting.
Prerequisites
- If you need to restore data from a remote HDFS, a standby cluster has been created and the data has been backed up. For details, see Backing Up HDFS NameNode Data. 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 Mutual Trust Between MRS Clusters. If the active cluster is deployed in normal mode, mutual trust is not required.
- Cross-cluster replication has been configured for the active and standby clusters. For details, see Enabling MRS Inter-Cluster Replication.
- Time is consistent between the active and standby clusters, with the NTP services on both clusters configured to use the same time source.
- 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.
Restoring HDFS NameNode Metadata
- Log in to MRS Manager.
For details about how to log in to MRS Manager, see Accessing MRS Manager.
- Choose Cluster > Services > HDFS. On the displayed page, click Instances and then NameNode to check whether the NameNode instances whose data is to be restored are stopped. If they are not, click Stop Instance to stop them.
- On FusionInsight Manager, choose O&M > Backup and Restoration > Backup Management.
- In the row containing the specified backup task, choose More > View History in the Operation column to display the task's historical execution records.
In the displayed window, locate the desired success record and click View in the Backup Path column to display the task's backup path information and obtain the following details:
- Backup Object: indicates the backup data source.
- Backup Path: indicates the full path where the backup files are stored.
Locate the correct path, and manually copy the full path of the backup files from the Backup Path column.
- 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.
- Select a backup directory type for Path Type of NameNode.
Table 1 Path for data restoration Type
Parameter
Description
LocalDir
Source Path
Backup file to be restored. File name format: Version_Data source_Task execution time.tar.gz
Target NameService Name
Name of the target NameService for the backup directory. The default value is hacluster.
RemoteHDFS
Source NameService Name
NameService name of the backup data cluster.
- You can set it to the NameService name (haclusterX, haclusterX1, haclusterX2, haclusterX3, or haclusterX4) of the built-in remote cluster.
- You can also set it to the NameService name of a configured remote cluster.
IP Mode
IP version of the target IP address. The system automatically determines the IP version, such as IPv4 or IPv6, based on the cluster network type.
Source NameNode IP Address
Service plane IP address of the active or standby NameNode in the standby cluster.
Source Path
Full path of the HDFS directory storing backup data in the standby cluster. Path format: Backup path/Backup task name_Data source_Task creation time/Version_Data source_Task execution time.tar.gz
Queue Name
Name of the YARN queue used for backup task execution. The name must be identical to that of a queue currently running properly in the cluster.
Target NameService Name
Name of the target NameService for the backup directory. The default value is hacluster.
NFS
IP Mode
IP version of the target IP address. The system automatically determines the IP version, such as IPv4 or IPv6, based on the cluster network type.
Server IP Address
IP address of the NAS server.
Source Path
Full path of the NAS server directory storing backup files. Path format: Backup path/Backup task name_Data source_Task creation time/Version_Data source_Task execution time.tar.gz
Target NameService Name
Name of the target NameService for the backup directory. The default value is hacluster.
CIFS
IP Mode
IP version of the target IP address. The system automatically determines the IP version, such as IPv4 or IPv6, based on the cluster network type.
Server IP Address
IP address of the NAS server.
Port
Port number used by the CIFS protocol to connect to the NAS server. The default value is 445.
Username
Username configured during CIFS protocol setup.
Password
Password configured during CIFS protocol setup.
Source Path
Full path of the NAS server directory storing backup files. Path format: Backup path/Backup task name_Data source_Task creation time/Version_Data source_Task execution time.tar.gz
Target NameService Name
Name of the target NameService for the backup directory. The default value is hacluster.
SFTP
IP Mode
IP version of the target IP address. The system automatically determines the IP version, such as IPv4 or IPv6, based on the cluster network type.
Server IP Address
IP address of the server where the backup data is stored.
Port
Port number used by the SFTP protocol to connect to the backup server. The default value is 22.
Username
Username used to connect to the server over SFTP.
Password
Password used to connect to the server over SFTP.
Source Path
Full path of the backup server directory storing backup files. Path format: Backup path/Backup task name_Data source_Task creation time/Version_Data source_Task execution time.tar.gz
Target NameService Name
Name of the target NameService for the backup directory. The default value is hacluster.
OBS
Source Path
Full path of the OBS directory storing backup files. Path format: Backup path/Backup task name_Data source_Task creation time/Version_Data source_Task execution time.tar.gz
Target NameService Name
Name of the target NameService for the backup directory. The default value is hacluster.
- Click OK.
- In the restoration task list, locate the row containing the 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.