Database Backup (DBS) provides the backup gateway feature that allows you to back up data from anon-premises database to DBS. You can download the installation package from the DBS console and install the backup gateway on your server where the database is deployed.

Prerequisites

  • Java Runtime Environment (JRE) 1.8 is installed on the server where the database is deployed.
    Note
    • You can download Java Runtime Environment (JRE) 1.8from Java SE Development Kit 8 Downloads.
    • JRE installation command (CentOS): yum install java-1.8.0-openjdk -y
    • JRE installation command (Ubuntu): apt-get install openjdk-8-jre
  • Before you begin, make sure that the following operations are complete:
    • An AccessKey pair is created, and information of AccessKey ID and AccessKey Secret is obtained. The AccessKey pair is used for identity verification when you register or log on to the DBS console from your backup gateway on the client side. For more information, see Create AccessKey pairs.
    • To add a RAM user, make sure that the AliyunDBSFullAccess and AliyunOSSFullAccess permissions are obtained. For more information, see Grant permissions to a RAM user.
      Note
      • By default, the preceding permissions are granted to the Alibaba Cloud account when you activate DBS.
      • After RAM users are added, the backup gateway is available to all users of the current Alibaba Cloud account in the DBS console.
  • The disk space in which the backup gateway is installed is greater than 1 GB and has the following permissions on your server where the database is deployed:
    • Linux: root permissions.
    • Windows: administrator permissions.

Usage notes

  • If a backup gateway is installed, we recommend that you uninstall the original backup gateway and clean up the environment. To uUninstall a backup gateway, use the following methods:
    • Linux: Run the java -jar Uninstaller/uninstaller.jar -c command in the installation directory.
      Note The default installation path is /usr/local/aliyun/dbs_agent.
    • Windows: Uninstall Aliyun DBS Agent from programs and features.
      Note The default installation path is C:\Program Files\aliyun\dbs_agent.
  • To back up SQL Server databases, you must assign the Sysadmin role to the NT AUTHORITY\SYSTEM account. For more information about specific operations, see FAQ.
    Note By default, NT AUTHORITY\SYSTEM is used to start AliyunDBSAgent.

Features

  • Purposes

    A backup gateway is a DBS backup client installed on a server where the database is deployed. The backup gateway allows you to back up a database from an on-premises device to DBS.

    Note You do not need to install a backup gateway for logical backup.
    Purpose Concept Description
    Physical backup Physical backup is the database file-level backup. The backup content is the database files on the operating system. The backup gateway starts a process on the server where the database is deployed. This way, you can receive the operation tasks and backup schedule configuration tasks that you run in the DBS console. The backup gateway also performs operations to backup and restore data on databases.
    Private network backup A database is in a private network environment such as a private network database of the on-premises data center or a private network database of another cloud service provider. DBS cannot access and back up database in a private network environment. The backup gateway accesses the DBS server and OSS to allow DBS to access databases in private networks.
    Automatic download DBS supports automatic download of backup sets to on-premises storage. The backup gateway downloads backup sets on cloud storage to the on-premises device to protect databases in the cloud on a regular basis.
  • Scenario configurations

    DBS provides DBS backup gateway components and Database Gateway (DG) components to connect to the on-premises data and the bastion host data.

    Table 1. Scenario configurations
    Scenario Description
    Network topology model of non-bastion host Installs the DBS backup gateway on the server where the database is deployed.
    Network topology model of bastion host

    The server where the database is deployed is in an internal network and cannot connect to the Internet. You must use a bastion host proxy to access the Internet.

    The backup gateway on the server where the database is deployed can communicate with an external network by using the DG on bastion host. Configurations:
    • Install the DG components on bastion host.
    • Install a DBS backup gateway on the server where the database is deployed. When you install the backup gateway, enter the IP address of the DG. The IP address of the DG is the IP address of bastion host.
  • Installation method
    DBS backup gateways are automatically installed in a graphic user interface (GUI) or by using command lines based on the system environment. You can also use the unattended installation mode.
    Note By default, a GUI is used to install a backup gateway. DBS determines whether the current environment supports GUI, such as Windows or Linux GNOME and KDE. If the current environment does not support GUI, the command line method is used to install a backup gateway.

    You need only to install the backup gateway once. The backup gateway can be automatically upgraded without additional updates when new versions are released.

    For more information, see Install a backup gateway by using command lines, Install a backup gateway in GUI, and Unattended installation.

Install a backup gateway by using command lines

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Gateways and select the required region in the upper-left corner.
    Select a backup gateway in a backup region
    Note Select the region closest to where your database is deployed. For example, if your database is deployed in Hangzhou, we recommend that you install a backup gateway in the China (Hangzhou) region.
  3. Click Install Backup Gateway in the upper-right corner of the page.
    Install Backup Gateway
  4. Select Backup Gateway Network Type and copy the command to install the backup gateway. Run the command on the server where the database is deployed.
    Note
    • Public Network: You can access DBS by using a public IP address.
    • ECS Private Network / VPC: You can access DBS by using a dedicated line from Alibaba Cloud.
    Copy the installation command of the backup gateway on the -linux command line
    1. On the Linux command line, run the command.
      Run the command on the -linux command line
      The system downloads and runs the installation package.
    2. Select an installation language. Enter 1 to select English.
      Select the -linux installation language
    3. Enter 1 to read the DBS backup gateway agreement.
      Read the agreement
    4. Enter 1 to accept the DBS backup gateway agreement.
      Accept the agreement
    5. Select components to install. By default, the DBS backup gateway (Agent) is installed. Enter Y to confirm the installation.
      Confirm to start installation
      Note This example describes how to install a DBS backup gateway. If you want to install a DG, enter N in this step. After the system switches to the installation of DG, enter Y.

      For more information about the data that the database gateway uses to connect to bastion host, see Table 1.

    6. Confirm the path of the installation.
    7. Confirm the region of the backup gateway and press the Enter key.
      Note Confirm again that Agent Region is the region nearest to where the database is deployed. If you want to change the region, enter the number corresponding to the region that you want to select.
    8. Set AccessKey ID and AccessKey Secret.
      Enter the AccessKey pair information
      Note If the AccessKey pair information is invalid, the installation fails.
    9. Enter the DG information.
      Note If you use a non-bastion host architecture, press the Enter key to skip this step.

      If you use the bastion host architecture, you must enter the DG information. For more information, see Table 1.

    10. Confirm the components to be installed. Enter 1 to start the installation.
      Wait for the installation to complete. The installation takes about 1 to 5 minutes.
  5. In the DBS console, click Complete Installation.
    On the Backup Gateways page, click Refresh to view the added backup gateway.

You can use the following commands to manage the backup gateway in Linux:

  • Start a backup gateway: /usr/local/aliyun/dbs_agent/bin/aliyun-dbs-agent.sh start
  • Stop a backup gateway: /usr/local/aliyun/dbs_agent/bin/aliyun-dbs-agent.sh stop
  • Restart a backup gateway: /usr/local/aliyun/dbs_agent/bin/aliyun-dbs-agent.sh restart
  • Uninstall a backup gateway: Run the java -jar Uninstaller/uninstaller.jar -c command from the installation directory

Install a backup gateway in GUI

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Gateways and select the required region in the upper-left corner.
    Select a backup gateway in a backup region
    Note Select the region nearest to where your database is deployed. For example, if your database is deployed in Hangzhou, we recommend that you install a backup gateway in the China (Hangzhou) region.
  3. Click Install Backup Gateway in the upper-right corner of the page.
    添加备份网关按钮
  4. Copy the command to install the backup gateway and run the command in the Windows command line window.
    Run the installation command
    Note You can also find the latest download link in the installation command in the console and manually download the installation package.
    1. Select an installation language, and click Next.
    2. Read and accept the terms of the agreement, and click Next.
    3. Select DBS Agent and click Next.
      Note In this example, the DBS Agent is installed. The DG is used to connect data of bastion host. For more information, see Table 1.
    4. Select the installation path, click Next, and then click Yes.
    5. Confirm Agent Region, set AccessKey ID and AccessKey Secret, and then click Next.
      Note
      • Confirm again that Agent Region is the region nearest to where the database is deployed. If you want to adjust the region, select another region.
      • The AccessKey pair information is stored in the plaintext format in .\config\dbs-agent.conf in the installation directory.
    6. Confirm the component package that you want to install and click Next.
      The software starts to install. The installation takes about 1 to 5 minutes to complete.
    7. After the installation is complete, click Next.
    8. Click Done.
      The backup gateway is installed.
  5. In the Run command of Windows, enter services.msc and click OK.
    Open the service manager for the system.
  6. In the service manager, check whether the service is started. If the service is not started, right-click AliyunDBSAgent. In the shortcut menu that appears, select Start.
    Note By default, the system starts the backup gateway. You can also start and stop the AliyunDBSAgent service in the service manager.
  7. In the DBS console, click Complete Installation.
    On the Backup Gateways page, click Refresh to view the added backup gateway.

Unattended installation

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Gateways and select the required region in the upper-left corner.
    Note Select the region closest to where your database is deployed. For example, if your database is deployed in Hangzhou, we recommend that you install a backup gateway in the China (Hangzhou) region.
  3. Click Install Backup Gateway in the upper-right corner of the page.
  4. Copy the download path of the software and manually download the software to the server.
    Copy the download path
  5. Run the following command in the path to which the software is installed on the server.
    java -Dregion=cn-hangzhou -DINSTALL_GROUP=Agent -Dakid=xxx -Daksecret=xxx -DINSTALL_PATH=/usr/local/aliyun/dbs_agent -jar aliyunDBSAgentInstaller-version.jar -options-system -language eng 
    Table 2. Parameter description
    Parameter Description
    region The region of the backup gateway. We recommend that you set this parameter to the region where the database resides.
    Note If you do not specify this parameter, the default value cn-hangzhou is used.
    DINSTALL_GROUP The components to install. Valid values:
    • Agent: the backup gateway
    • DG: the database gateway
    Dakid The AccessKey ID.
    Daksecret The AccessKey Secret.
    DINSTALL_PATH The directory where the software is installed.
    aliyunDBSAgentInstaller-version.jar The name of the software.

FAQ

  • What do I do if the backup account does not have the required permissions to back up SQL Server databases?

    Solution: Assign the Sysadmin role to the NT AUTHORITY\SYSTEM account to back up SQL Server databases. Execute the following SQL statement or or assign the role in GUI:

    SQL statement
    ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
    GO
  • The version of the backup gateway is not the most recent.

    Solution: Reinstall a backup gateway with the latest version.