Index Backup and Restoration
You can back up index data in clusters to avoid data loss. If data loss occurs or you want to retrieve data of a specified duration, you can restore the index data to obtain the data quickly. Index backup is implemented by creating cluster snapshots. When backing up for the first time, you are advised to back up data of all indices.
Snapshot creation is unavailable for clusters that were created before March 10, 2018, when the backup and index restoration function was deployed.
- Managing Automatic Snapshot Creation: Snapshots are automatically created at a specified time each day according to the rules you create. You can enable or disable the automatic snapshot creation function and set the automatic snapshot creation policy.
- Manually creating a snapshot: You can manually create a snapshot at any time to back up all data or data of specified indices.
- Restoring data: You can use existing snapshots to restore the backup index data to a specified cluster.
- Deleting a snapshot: You are advised to delete invalid snapshots to release storage resources.
- Before creating a snapshot, you need to perform basic configurations, including configuring the OBS bucket for storing snapshots, the snapshot backup path, and IAM agency used for security authentication.
- If there are available snapshots in the snapshot list when you configure the OBS bucket for storing cluster snapshots for the first time, the bucket cannot be changed for all snapshots that are automatically or manually created later. Therefore, exercise caution when you configure the OBS bucket.
- If you want to change the OBS bucket where there are snapshots, do as follows: Disable the snapshot function, enable it, and specify a new OBS bucket.
Once the snapshot function is disabled, the previously created snapshots cannot be used to restore the cluster.
- If a cluster is in the Unavailable state, you can only use the cluster snapshot function to restore clusters and view existing snapshot information without being able to edit.
- During backup and restoration of a cluster, allowed operations on the cluster include capacity expansion, Kibana access, metric viewing, and deletion of other snapshots of clusters, but the following operations are not allowed: restart or deletion of the cluster, deletion of a snapshot that is in the Creating or Restoring state, and creating or restoring another snapshot. If a snapshot is being created or restored for a cluster, then the automatic snapshot creation task initiated for the cluster will be canceled.
Prerequisites
To use the function of creating or restoring snapshots, the account or IAM user used for logging in to the CSS management console must have both of the following permissions:
- Tenant Administrator for project OBS in region Global service
- Elasticsearch Administrator in the current region
Managing Automatic Snapshot Creation
- In the left navigation pane of the CSS management console, click Clusters.
- On the Clusters page that is displayed, click the name of the target cluster. On the displayed page, click Cluster Snapshots.
Alternatively, on the Clusters page, locate the row where the target cluster resides and click More > Back Up and Restore in the Operation column to switch to the Cluster Snapshots page.
- On the displayed Cluster Snapshots page, click the icon to the right of Cluster Snapshot to enable the cluster snapshot function.
indicates that the cluster snapshot function is disabled.
indicates that the cluster snapshot function is enabled. - (Optional) After the cluster snapshot function is enabled, CSS automatically creates the OBS bucket, backup path, and IAM agency for you to store snapshots. The automatically created OBS bucket, backup path, and IAM agency are displayed on the page. If you want to change the OBS bucket, backup path, and IAM agency, click
on the right of Basic Configuration. In the displayed Edit Basic Configuration dialog box, you can either select an existing OBS bucket and an IAM agency or create an OBS bucket and an IAM agency. To create an OBS bucket, click Create Bucket. To create an IAM agency, click Create IAM Agency. For details, see Creating a Bucket and Creating an Agency.Table 1 Parameter description Parameter
Description
Precautions
OBS Bucket
Name of the OBS bucket used for storing snapshots.
The following conditions must be met for existing OBS buckets or those to be created:
- Storage Class is Standard or Infrequent Access.
- Region is CN North-Beijing1, CN East-Shanghai2, or CN South-Guangzhou.
Backup Path
Storage path of the snapshot in the OBS bucket.
The backup path configuration rules are as follows:- The backup path cannot contain the following characters: \:*?"<>|
- The backup path cannot start with a slash (/).
- The backup path cannot start or end with a period (.).
- The total length of the backup path cannot exceed 1,023 characters.
IAM Agency
IAM agency authorized by the current account to CSS to access or maintain data stored in OBS.
The following conditions must be met for existing IAM agencies or those to be created:
- Agency Type is Cloud service.
- Cloud Service is Elasticsearch.
- The agency has the Tenant Administrator permission for the OBS project in Global service.
Figure 1 Basic configuration
- Click the icon to the right of Automatic Snapshot Creation to enable the automatic snapshot creation function.
indicates that the automatic snapshot creation function is enabled, and
indicates that the automatic snapshot creation function is disabled.Figure 2 Enabling or disabling the automatic snapshot creation function
- In the displayed Edit Snapshot Policy dialog box, specify parameters as required.
- Snapshot Name Prefix: The snapshot name consists of the snapshot name prefix (indicated by this parameter) and time. For example, snapshot-2018022405925, an automatically generated snapshot name. The snapshot name prefix contains 1 to 31 characters and must start with a lowercase letter. Only lowercase letters, digits, hyphens (-), and underscores (_) are allowed.
- Time Zone: indicates the time zone for the backup time. Specify Backup Started based on the time zone.
- Backup Started: indicates the time when the backup starts automatically every day. You can only specify this parameter to an hour's time, for example, 00:00 or 01:00. The value ranges from 00:00 to 23:00. Select the backup time from the drop-down list box.
- Retention Period (days): indicates the duration when snapshots are retained in the OBS bucket, in days. The value ranges from 1 to 90. You can specify this parameter as required. The system automatically deletes snapshots that are retained over the specified retention period on the half hour. For example, if you set the snapshot policy as shown in Figure 3, the system will automatically delete in 35 days at 00:30 the automated snapshots that were created 35 days earlier at 00:00.
- Click OK.
After the policy for automatic snapshot creation is created, the policy information will be displayed on the Cluster Snapshots page. See Figure 4. If you need to change the policy due to business changes, click
.Snapshots that are automatically created according to the snapshot policy are displayed in the snapshot list. All automatically and manually created snapshots are displayed in the snapshot list. You can distinguish them by the Snapshot Type setting. In the upper right corner of the snapshot list, enter the keyword of the snapshot name or snapshot ID to search for the desired snapshots. You can also click
to sort the snapshots based on related parameter settings. - (Optional) Disable the automatic snapshot creation function.
After you disable the automatic snapshot creation function, the system stops automatic creation of snapshots. If the system is creating a snapshot based on the automatic snapshot creation policy and the snapshot has not been displayed in the snapshot list, you cannot disable the automatic snapshot creation function. In this case, if you click the button next to Automatic Snapshot Creation, a message is displayed, indicating that you cannot disable the function. You are advised to disable the function after the system completes automatic creation of the snapshot, specifically, the created snapshot is displayed in the snapshot list.
When disabling the automatic snapshot creation function, you can choose whether to delete the snapshots that have been automatically created by configuring Delete automated snapshots in the displayed dialog box. By default, automatically created snapshots are not deleted.
- If you do not select Delete automated snapshots, automatically created snapshots are not deleted when you disable the automatic snapshot creation function. In this case, you can manually delete them in the future. For details, see Deleting a Snapshot. If you do not manually delete the automatically created snapshots and enable the automatic snapshot creation function again, then all snapshots with Snapshot Type set to Automated in the snapshot list of the cluster can only be automatically deleted by the system. Specifically, the system automatically deletes snapshots based on the snapshot policy configured when you enable the automatic snapshot creation function again. For example, if you set Retention Period (days) to 10, the system will automatically delete the snapshots that have been retained for more than 10 days.
- If you select Delete automated snapshots, all snapshots with Snapshot Type set to Automated in the snapshot list will be deleted when you disable the automatic snapshot creation function.
Manually Creating a Snapshot
- In the left navigation pane of the CSS management console, click Clusters.
- On the Clusters page that is displayed, click the name of the target cluster. On the displayed page, click Cluster Snapshots.
Alternatively, on the Clusters page, locate the row where the target cluster resides and click More > Back Up and Restore in the Operation column to switch to the Cluster Snapshots page.
- On the displayed Cluster Snapshots page, click the icon to the right of Cluster Snapshot to enable the cluster snapshot function.
indicates that the cluster snapshot function is disabled.
indicates that the cluster snapshot function is enabled. - (Optional) After the cluster snapshot function is enabled, CSS automatically creates the OBS bucket, backup path, and IAM agency for you to store snapshots. The automatically created OBS bucket, backup path, and IAM agency are displayed on the page. If you want to change the OBS bucket, backup path, and IAM agency, click
on the right of Basic Configuration. For details about how to configure parameters involved in the basic configuration, see 4. - After basic configurations are completed, click Create.
- Name: indicates the name of the manually created snapshot, which contains 4 to 64 characters and must start with a lowercase letter. Only lowercase letters, digits, hyphens (-), and underscores (_) are allowed. Unlike the name of an automatically created snapshot, the name of a manually created snapshot is set as specified and time information is not automatically added to the name.
- Index: Enter the name of an index. The manually created snapshot can back up data of certain indices in the cluster. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?) are not allowed. Multiple index names are separated by commas (,). If this parameter is left unspecified, data of all indices in the cluster is backed up by default. You can use the asterisk (*) to back up data of certain indices. For example, if you enter 2018-06*, then data of indices with the name prefix of 2018-06 will be backed up.
You can use the GET /_cat/indices command in Kibana to query names of all indices in the cluster. You can then enter the names of the indices you want to back up.
- Description: indicates the description of the created snapshot. The value contains 0 to 256 characters, and certain special characters (<>) are not allowed.
Figure 5 Manually creating a snapshot
- Click OK.
After the snapshot is created, it will be displayed in the snapshot list. Status Available indicates that the snapshot is created successfully. All automatically and manually created snapshots are displayed in the snapshot list. You can distinguish them by the Snapshot Type setting. In the upper right corner of the snapshot list, enter the keyword of the snapshot name or snapshot ID to search for the desired snapshots. You can also click
to sort the snapshots based on related parameter settings.
Restoring Data
You can use snapshots whose Snapshot Status is Available to restore cluster data. The stored snapshot data can be restored to other clusters.
Restoring data will overwrite current data in clusters. Therefore, exercise caution when restoring data.
- In the Snapshots area, locate the row where the snapshot you want to restore resides and click Restore in the Operation column.
- In the displayed dialog box, specify parameters as required.
Index: Enter the name of the index you want to restore. By default, this option is left blank, indicating that data of all indices is restored. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?) are not allowed.
Rename Pattern: Enter a regular expression. Indices that match the regular expression are restored. The default value index_(.+) indicates restoring data of all indices. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?,) are not allowed.
Rename Replacement: Enter the index renaming rule. The default value restored_index_$1 indicates that restored_ is added in front of the names of all restored indices. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?,) are not allowed. The setting of Rename Replacement takes effect only when Rename Pattern is specified.
Cluster: Select the cluster that you want to restore. You can select the current cluster or others. However, you can only restore the snapshot to clusters in the Available state. If the current cluster is in the Unavailable state, you cannot restore the snapshot to the current cluster. If you choose to restore the snapshot to another cluster, ensure that the target cluster runs an Elasticsearch version not earlier than that of the current cluster. If you select another cluster and two or more indices in the cluster have the same name, data of all indices with the same name as the one you specify will be overwritten. Therefore, exercise caution when you set the parameters.Figure 6 Restoring a snapshot
- Click OK. If restoration succeeds, Task Status of the snapshot in the snapshot list will change to Restoration succeeded, and the index data is generated again according to the snapshot information. In the snapshot list, the Task Status column indicates the latest status of a snapshot and displays Restoration succeeded only when the latest restoration of a snapshot succeeds.Figure 7 Successful restoration
Deleting a Snapshot
If you no longer need a snapshot, delete it to release storage resources. If the automatic snapshot creation function is enabled, snapshots that are automatically created cannot be deleted manually, and the system automatically deletes these snapshots on the half hour after the time specified by Retention Period (days). If you disable the automatic snapshot creation function while retaining the automated snapshots, then you can manually delete them later. If you do not manually delete the automatically created snapshots and enable the automatic snapshot creation function again, then all snapshots with Snapshot Type set to Automated in the snapshot list of the cluster can only be automatically deleted by the system.
After a snapshot is deleted, its data cannot be restored. Therefore, exercise caution when deleting a snapshot.
- In the Snapshots area, locate the row where the target snapshot resides and click Delete in the Operation column.
- In the Delete Snapshot dialog box that is displayed, click Yes.
Last Article: Viewing Package Details
Next Article: Modifying Specifications


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.