No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

HUAWEI CLOUD Stack 6.5.0 Backup and Restoration Guide 03

Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Backing up Karbor Data

Backing up Karbor Data

Configuring a Backup Policy

After the Karbor system is successfully installed, it automatically backs up the Gauss database, KMC key files, WCC key files, and digital certificates at 00:00 every day, using the default password CloudService@123! to encrypt backup data.

This section describes how to change the backup time, password for encrypting backup data, and backup storage.

Prerequisites

The password of the djmanager account has been obtained.

Context
  • When configuring a management data backup policy, you need to calculate the capacity of shared storage in advance. When the capacity is insufficient, the latest backup task will fail. The capacity is related to the backup data retention policy.

    Capacity of shared storage = [0.2 x Number of reserved backups + 10] GB

    For example, if the number of reserved backups is 7, the capacity of shared storage is = [0.2 x 7 + 10] GB = 11.4 GB.

  • Configure separate backup storage space for Karbor management data.
  • If no management data backup policy is configured during the installation of Karbor, backup data is stored in the /opt/djbackup/db directory on the active GaussDB node. It retains the latest seven copies of backup data.
  • If a backup server is configured during the installation of Karbor, backup data is stored in a specified path on the backup server.
    NOTE:

    When Karbor is automatically installed, only the backup server that uses the SFTP protocol can be configured.

Precautions
  • If the database is backed up during service running, some data may not be saved into the database, resulting in data inconsistency. You are advised to back up the database after services are complete or when there are a few services running.
  • If NFS share paths are used, only NFSv3 is supported.
  • To configure NFS as the backup storage of management data, ensure that the network connection between the Karbor server and NFS is normal.
Procedure
  1. Use PuTTY to log in to any Service-CSBS node through the IP address corresponding to the CSBS_Service field.

    The default account and password are djmanager and CloudService@123!, respectively.

  2. Run the following command to change the backup time.

    set_backup_policy --service gaussdb --time hh:mm-hh:mm

    Enter n as prompted.

    In the preceding commands, hh:mm indicates the backup time, where hh indicates hour and mm indicates minute. You can set a maximum of 24 backup times. Each backup time is separated by a hyphen (-).

    Example:

    set_backup_policy --service gaussdb --time 00:00-23:59 
    Do you want to reset the backup password(y/n):n  
    Commit successfully

  3. Run the following command to change the backup encryption password.

    set_backup_policy --service gaussdb --time hh:mm-hh:mm

    Enter y as prompted.

    In the preceding command, hh:mm indicates the backup time, where hh indicates hour and mm indicates minute. If the backup time has been changed as instructed in Step 2, enter the new backup time. If not changed, enter the default backup time 00:00.

    Example:

    set_backup_policy --service gaussdb --time 00:00-23:59 
    Do you want to reset the backup password(y/n):y 
    Input new password: 
    Confirm password: 
    Commit successfully     

  4. If you use an SFTP-based backup server to store the backup management data (databases and configuration files), configure the backup storage by referring to the following steps.

    1. Use PuTTY to log in to any Service-CSBS node through the IP address corresponding to the CSBS_Service field.

      The default account and password are djmanager and CloudService@123!, respectively.

    2. Run the following command to set the backup policy for backing up the system management data to the backup server:

      set_backup_server_policy --enable <ENABLE> --schema <SCHEMA> --ftp_ip <FTP_IP> --ftp_port <FTP_PORT> --ftp_path <FTP_PATH> --ftp_schema <FTP_SCHEMA> --backups_retain <BACKUPS_RETAIN> --log_retain <LOG_RETAIN>

      Table 1-12 describes parameters in the command.
      Table 1-12 SFTP configuration parameter description

      Parameter

      Description

      Example Value

      <ENABLE>

      Whether to enable the export policy. The value can be true or false.

      Here, set this parameter to true.

      • true: indicates the export policy is enabled (The default value is true).
      • false: indicates the export policy is disabled.

      true

      <SCHEMA>

      Backup server selection. The value can be nfs or ftp.

      Here, set this parameter to ftp.

      ftp

      <FTP_IP>

      IP address of the backup server.

      192.168.100.100

      <FTP_PORT>

      Port of the backup server.

      22

      <FTP_PATH>

      Relative path for storing backup data on the backup server.

      backup_path

      <FTP_SCHEMA>

      Protocol used for exporting files to the backup server. The protocol can be FTP, FTPS, or SFTP.

      NOTE:

      If FTP is used, there are network security risks. Therefore, SFTP is recommended.

      sftp

      <BACKUPS_RETAIN>

      Number of retained backups. The value ranges from 7 to 30.

      10

      <LOG_RETAIN>

      Log retention period. The value ranges from 3 to 12, expressed in month.

      5

      Example:

      Configure a backup export policy on the FTP server. The IP address is 192.168.100.100, the port number is 22, and the relative path is backup_path. SFTP is used as the backup protocol, the number of retained backups is 10 (latest 10 backup copies), and the log retention period is five months.

      set_backup_server_policy --enable true --schema ftp --ftp_ip 192.168.100.100 --ftp_port 22 --ftp_path backup_path --ftp_schema sftp --backups_retain 10 --log_retain 5

      NOTE:
      • After changing the password of the account for logging in to the backup server, perform this operation to reconfigure the backup storage.
      • The user for logging in to the backup server is created on the server. The password is set when the user is created.

  5. If you use the NFS shared storage to store the backup management data (databases and configuration files), configure the backup storage by referring to the following steps.

    1. Use PuTTY to log in to any Service-CSBS node through the IP address corresponding to the CSBS_Service field.

      The default account and password are djmanager and CloudService@123!, respectively.

    2. Run the following command to set the backup policy for backing up the system management data to the NFS backup server:

      set_backup_server_policy --enable true --schema nfs --nfs_path <NFS_PATH> --nfs_tag <NFS_TAG> --backups_retain <BACKUPS_RETAIN> --log_retain <LOG_RETAIN>

      Table 1-13 describes parameters in the command.

      Table 1-13 NFS configuration parameter description

      Parameter

      Description

      Example Value

      <ENABLE>

      Whether to enable the export policy. The value can be true or false.

      Here, set this parameter to true.

      • true: indicates the export policy is enabled (The default value is true).
      • false: indicates the export policy is disabled.

      true

      <SCHEMA>

      Backup server selection. The value can be nfs or ftp.

      Here, set this parameter to nfs.

      nfs

      <NFS_PATH>

      Root directory for saving logs on the NFS server. The path format is IP address (or domain name):/Share path, among which IPaddress and domain name indicate the service IP address and domain name of the NAS storage system, respectively. You need to obtain the NFS share path from the administrator in advance.

      192.168.100.100:/home/backup

      <NFS_TAG>

      Identifier of the NFS server, which is the name of the self-defined folder for storing backup data in the NFS share path. It differentiates the folder from other existing folders in the NFS share path and also facilitates quick locating of backup data when restoring data is required.

      backup_file

      <BACKUPS_RETAIN>

      Number of retained backups. The value ranges from 7 to 30.

      10

      <LOG_RETAIN>

      Log retention period. The value ranges from 3 to 12, expressed in month.

      5

      Example:

      Configure a backup export policy on the NFS server. The export path is 192.168.100.100:/home/backup, the identifier is backup_file, the number of retained backups is 10 (latest 10 backup copies), and the log retention period is five months.

      set_backup_server_policy --enable true --schema nfs --nfs_path 192.168.100.100:/home/backup --nfs_tag backup_file --backups_retain 10 --log_retain 5

Viewing Automatic Backup Data

After the Karbor system is successfully installed, it is automatically backed up.

Procedure
  • After the Karbor system is successfully installed, it automatically backs up the Gauss database, KMC key files, WCC key files, and digital certificates at 00:00 every day, using the default password CloudService@123! to encrypt backup data. It retains the latest seven copies of backup data. If Karbor is installed as a three-node cluster, backup data is stored in /opt/djbackup/db on the active GaussDB node.
  • If a backup server is configured, the system first automatically backs up the Gauss database, KMC key files, WCC key files, and digital certificates at the configured time and then copies the backup data to the backup server immediately.

    The backup data is stored in the share path on the backup server. The path is specified in the 4.b.

  • If an NFS shared path is configured, the system first automatically backs up the Gauss database, KMC key files, WCC key files, and digital certificates at the configured time and then copies the backup data to the path to which the NFS shared space is mounted on the Service-CSBS node immediately.

    The default path is /opt/huawei/dj/bin/backup/log_agent.

    If the shared path has been changed, the backup data will be saved in the path on the NFS server configured in 5.b.

Manually Backing Up Data

If the period of scheduled backup cannot meet backup requirements, you can manually back up the Gauss database, KMC key files, WCC key files, and digital certificates.

Prerequisites

The password of the djmanager account has been obtained.

Precautions
  • Manual backup can be executed only on the active GaussDB node.
  • During the scheduled backup of the system, do not perform manual backup. Otherwise, the backup will fail.
  • If the database is backed up during service running, some data may not be saved into the database, resulting in data inconsistency. You are advised to back up the database after services are complete or when there are a few services running.
  • If NFS share paths are used, only NFSv3 is supported.
Procedure
  1. Use PuTTY to log in to any Service-CSBS node through the IP address corresponding to the CSBS_Service field.

    The default account and password are djmanager and CloudService@123!, respectively.

  2. Run the following command to check whether this node is the active node.

    sudo /opt/huawei/dj/bin/backup/backup/gaussdb_backup_base.sh role
    • If the command output contains Primary, this node is the active node. In this case, go to Step 3.
    • If the command output does not contain Primary, this node is not the active node. In this case, perform Step 1 to log in to another Service-CSBS node.

  3. Run the following command to back up data in the Gauss database, KMC key files, WCC key files, and digital certificates.

    sudo /opt/huawei/dj/bin/backup/backup/gaussdb_backup_entry.sh

    When the system displays the message backup gaussdb successfully, data has been backed up successfully.

    sudo /opt/huawei/dj/bin/backup/backup/gaussdb_backup_entry.sh  
    gaussdbBackup: INFO | Starting to back up data 
    gaussdbBackup: INFO | backup file path is: /opt/djbackup/db/manualbk/gaussdb_backup_20180419233311199053704.all.tar.gz 
    gaussdbBackup: INFO | backup gaussdb successfully.

  4. Run the following command to access the directory for storing backup data to view backup files.

    cd /opt/djbackup/db/manualbk

Translation
Download
Updated: 2019-06-14

Document ID: EDOC1100062366

Views: 772

Downloads: 9

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next