Updated on 2025-12-10 GMT+08:00

Restoring Flink Metadata

Scenarios

Flink metadata restoration is required in the following scenarios: when data is unexpectedly modified or deleted and requires retrieval; when major Flink operations (such as upgrades or migration) cause exceptions in system data or fail to achieve the expected result; when all Flink modules fail and become unavailable; and when data is migrated to a new cluster.

Flink 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 Flink metadata.

  • LocalDir: indicates that data is restored from the local disk of the active management node.
  • LocalHDFS: indicates that data is restored from the HDFS directory of the current cluster.
  • RemoteHDFS: indicates that data is restored from the HDFS directory of the standby cluster.
  • OBS: indicates that data is restored from OBS.

To restore Flink metadata when the service is running properly, it is recommended that you manually back up the latest Flink metadata prior to restoration. Otherwise, the Flink metadata that is generated after the data backup and before the data restoration will be lost.

Notes and Constraints

  • Data restoration can be performed only when the system version is consistent with the version used during data backup.
  • Flink metadata restoration and service data restoration cannot be performed simultaneously. Otherwise, service data restoration fails. You are advised to restore service data only after metadata restoration is complete.
  • MRS 3.5.0 and later support data restoration from OBS.

Impact on the System

  • Before restoring the metadata, you need to stop the Flink service. During this period, all upper-layer applications are affected and cannot work properly.
  • After the metadata is restored, the data generated after the data backup and before the data restoration is lost.
  • After the metadata is restored, the Flink upper-layer applications of Solr need to be started.

Prerequisites

  • You have checked the path for storing Flink metadata backup files.
  • The Flink service has been stopped before its metadata is restored.
  • 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 Flink Metadata. 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.

Restoring Flink Metadata

  1. Log in to MRS Manager.

    For details about how to log in to MRS Manager, see Accessing MRS Manager.

  2. Choose O&M > Backup and Restoration > Backup Management.
  3. In the Operation column of the specified task in the task list, choose More > View History.

    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.

  4. On FusionInsight Manager, choose O&M > Backup and Restoration > Restoration Management.
  5. Click Create.
  6. Set Task Name to the name of the restoration task.
  7. Select the cluster to be operated from Recovery Object.
  8. In Restoration Configuration, select Flink under Metadata and other data.
  9. Select a backup directory type for Path Type of Flink.

    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

    LocalHDFS

    Source Path

    Full path of the HDFS directory storing backup files. Path format: Backup path/Backup task name_Task creation time/Version_Data source_Task execution time.tar.gz

    Source NameService Name

    NameService name of the backup directory during restoration task execution. 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.

    OBS (available in MRS 3.5.0 and later)

    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

  10. Click OK.
  11. In the restoration task list, locate the row where the created task is located, and click Start in the Operation column. In the displayed dialog box, click OK to start 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.

  12. Choose Cluster > Services and start the Flink service.