Backup and Restoration

Last Updated At: 2026-08-14 08:08:00

  1. Database
    The stored data in the MySQL database mainly include alarm policies, cloud product access configurations, and environment configuration information. There are primary regional databases and regional databases. Primary regional databases are deployed in the primary region, while regional databases have an instance in each region.
    Back up the database. Take StormCloudConf as an example. You can use the following command.
    • Back up the whole database:
mysqldump-h${host} -P22001 -umysql_user -p'mysql_passwd' StormCloudConf >StormCloudConf_22001.sql
  • Back up the table:
mysqldump-h${host} -umysql_user -pmysql_passwd -P22001 StormCloudConf cStormTransmitMapcDictionaryConf > StormCloudConf_22001.sql
  cDictionaryConf and cStormTransmitMap are tables in the database StormCloudConf.
  • Recover the database with the above backup file:
mysql-h${host} -P22001 -umysql_user -pmysql_passwd -D StormCloudConf <  StormCloudConf_22001.sql
  1. Monitoring data
    1. ElasticSearch introduces the concepts of repository and snapshot to implement data backup and restoration.
    • Create a repository:
curl-xPOST http://${ES_IP}:9200/_snapshot/my_backup_1 -d'{
  "type": "fs",
  "settings": {
    "location":"\/data\/elasticsearch-5.1.1\/data\/back\/my_backup_1",
    "max_snapshot_bytes_per_sec":"20mb",
    "max_restore_bytes_per_sec":"20mb",
    "compress": true
  }
}'
  • The parameters are explained as follows:
    type: The type of the repository is a shared file system.
    location: Specify the path of the repository. It should be a subdirectory of path.repo.
    max_snapshot_bytes_per_sec: This parameter can control the traffic throttling of the process when snapshot data enters the repository. The default value is 20 MB per second.
    max_restore_bytes_per_sec: This parameter controls the traffic throttling of the process when data is restored from the repository. The default value is 20 MB per second.
    compress: Whether the data is compressed.

    Note:

    If the mounted path is a remote directory, you should reasonably configure this value to avoid network traffic overwhelming.

  1. Snapshot index:
    Snapshot all open indexes.
curl-XPUT http://${ES_IP}:9200/_snapshot/my_backup_1/snapshot_1?wait_for_completion=true
  Snapshot the specified index.
curl-XPUT http://${ES_IP}:9200/_snapshot/my_backup_1/snapshot_3 -d'{
  "indices":"my_index_1,my_index_2",
  "ignore_unavailable": true,
 "include_global_state": true
}'
  1. Recover the snapshot:
curl-XPOST http://${ES_IP}:9200/_snapshot/my_backup/snapshot_1/_restore?wait_for_completion=true
  1. Snapshot information:
    Obtain information for a single snapshot.
curl-XGET http://${ES_IP}:9200/_snapshot/my_backup/snapshot_1
  - Obtain information for all snapshots under the repository.
curl-XGET http://${ES_IP}:9200/_snapshot/my_backup/_all