Install the agent

更新时间:
复制 MD 格式

The Database Auditing agent is a software component that you deploy on your application server or database server. It forwards database access traffic to the Database Auditing system. To collect traffic from your target database, you must install the agent using a method suitable for your database server type. This topic describes how to install the agent.

Agent deployment locations

Depending on the type of database you want to audit, deploy the agent to a different location:

  • Alibaba Cloud RDS, PolarDB, PolarDB-X, AnalyticDB, and OceanBase databases

    The agent must be deployed on the application server that connects to the database.

  • Self-managed databases

    The agent can be deployed on the database server or the application server.

    Note
    • If your database is on an ECS instance in a classic network, you must first use ClassicLink to enable network communication between the ECS instance and the Database Auditing system in the Virtual Private Cloud (VPC). Then, install the agent on the ECS instance. For more information, see Audit a database instance in the classic network.

    • If your database is deployed in an on-premises IDC, you must establish a network connection between the on-premises IDC and the VPC of the Database Auditing system. Use Alibaba Cloud Express Connect to establish this connection. For more information, see Connect an on-premises IDC to a VPC over a leased line.

Agent installation methods

Before you install the agent, choose an installation method.

Installation method

Description

Limitations

Use cases

Install by using Cloud Assistant

Provides one-click agent installation from the Database Auditing console, eliminating the need for manual download and setup.

The server where you want to install the agent must meet the following requirements:

  • It is an Alibaba Cloud ECS instance with Cloud Assistant installed.

  • It is in the same VPC as the Database Auditing instance.

Automatically install agents on multiple ECS instances in batches.

Manually install the agent

Manually download the agent installation package for the server's operating system from the Database Auditing console and install it.

None. This method allows you to install the agent on any server.

  • Install the agent on a non-Alibaba Cloud server.

  • The Alibaba Cloud ECS instance does not have Cloud Assistant installed.

  • The Alibaba Cloud ECS instance and the Database Auditing instance are not in the same VPC.

Installation notes

  • On Linux, you must install the agent as the root user. On Windows, you must install the agent with administrator privileges.

  • Before you install the agent on a Windows system, check for and uninstall any security software.

  • For self-managed databases on Windows, if traffic is routed through the 127.0.0.1 loopback interface, the agent's traffic forwarding tool requires npcap to be installed.

    If you have an existing agent, you must first uninstall the agent and any installed winpcap driver. Then, install npcap before you reinstall the agent.

Install by using Cloud Assistant

You can install the agent on an ECS instance with a single click by using Cloud Assistant. We recommend this method if the target ECS instance has Cloud Assistant installed and is in the same VPC as your Database Auditing instance.

  1. Log on to the Database Auditing system. For more information, see Log on to the Database Auditing system.

  2. In the left-side navigation pane, choose System Management > Agent Management.

  3. On the Agent Management page, click the Agent Installation tab.

  4. In the Install by using Cloud Assistant section, click Start Installation.

  5. In the Install Agent by Using Cloud Assistant dialog box, select the ECS instances where you want to install the agent and click Install above the instance list.

    Alternatively, you can click Install in the Actions column for a specific ECS instance to install the agent only on that instance.

    After the installation is successful, the Agent Status for the corresponding ECS instance changes to Running, Connected.

Manually install the agent

You can manually install the agent on any required server by downloading the installation package.

  1. Log on to the Database Auditing system. For more information, see Log on to the Database Auditing system.

  2. In the left-side navigation pane, choose System Management > Agent Management.

  3. On the Agent Management page, click the Agent Installation tab.

  4. In the Manually Install Agent section, select the agent installation package for your operating system and install the agent.

    Linux

    1. In the Linux section, click X86-64 or ARM-64 based on your server architecture.

    2. After the agent installation package is created, click Download in the Download dialog box.

      The installation package is saved to your browser's default download location.

    3. Log on to your Linux server.

    4. Upload the downloaded agent installation package to a directory on the Linux server.

      You can choose any directory to store the agent installation package.

    5. Navigate to the directory that contains the package and run one of the following commands to decompress it.

      • X86 servers

        tar -zxvf dbagent_linux_V2.30.tar.gz
      • ARM servers

        tar -zxvf dbagent_arm_V2.30.tar.gz
      Important

      If you move the agent to a new directory, you must first uninstall it and then reinstall it.

    6. Run the following commands to install and enable the agent.

      cd dbagent2.30
      sh install.sh
      Important
      • Do not run the binary file directly.

      • You must run the agent installation script as the root user. Use bash as the interpreter, or do not specify an interpreter.

      • The sh install.sh command includes the sh start.sh operation, so you only need to run sh install.sh. No other actions are required.

    7. Run the following command to check the status of the agent processes. Ensure that the dbAgent and dbMonitor processes are running.

      ps -ef |grep dbagent
    8. Run the following commands to check the listening status of the ports between the agent and Database Auditing. Ensure that ports 13001 and 13002 are in the ESTABLISHED state.

      netstat -ano |grep 13001
      netstat -ano |grep 13002

    Windows

    1. In the Windows section, click 64-bit.

    2. After the agent installation package is created, click Download in the Download dialog box.

      The installation package is saved to your browser's default download location.

    3. Log on to your Windows server.

    4. Upload the downloaded agent installation package to the Windows server.

    5. Extract the agent installation package to a directory.

      Important
      • The directory path must not contain special characters. This includes spaces (<space>) and the following characters: (), [], {}, ^, =, ;, !, ', +, ,, `, ~, or &. If you must run the script from a directory that contains special characters, open a Command Prompt window with administrator privileges and run the script from there.

      • If you move the agent to a new directory, you must run the installation script again.

    6. Navigate to the extracted agent directory, right-click the dbAgent-setup.exe application, and select Run as administrator.

    7. In the installation wizard, click Next.

    8. Select Install npcap and click Next.

      The default installation directory is C:\dbAgent. If npcap or winpcap is already installed on your system, you can clear this checkbox. For scenarios where the application and the database are on the same machine, select npcap. You can also select the Data encrypted transmission option if needed. This option requires the VC++ 2015 runtime library.

    9. Follow the instructions in the installation wizard to complete the installation.

    10. In a Command Prompt window, run the following commands to check the listening status of the ports between the agent and Database Auditing. Ensure that ports 13001 and 13002 are in the ESTABLISHED state.

      netstat -ano |findstr 13001
      netstat -ano |findstr 13002

    AIX

    1. In the AIX section, click the version that matches your AIX server's operating system.

      Supported versions: 5.3, 6.1, and 7.1.

    2. After the agent installation package is created, click Download in the Download dialog box.

      The installation package is saved to your browser's default download location.

    3. Log on to your AIX server.

    4. Upload the downloaded agent installation package to a directory on the AIX server.

      You can choose any directory to store the agent installation package.

    5. Navigate to the directory where the package is stored and run the following commands.

      gunzip dbagent_aix5.3_V2.257.tar.gz
      tar -xvf dbagent_aix5.3_V2.257.tar
    6. Navigate to the extracted installation directory and run the following command to install the agent.

      ./install.sh
    7. Run the following command to check the status of the agent processes. Ensure that the dbAgent and dbMonitor processes are running.

      ps -ef |grep dbagent
    8. Run the following commands to check the listening status of the ports between the agent and Database Auditing. Ensure that ports 13001 and 13002 are in the ESTABLISHED state.

      netstat -ano |grep 13001
      netstat -ano |grep 13002

    The agent is automatically enabled after installation.

    If you encounter problems during installation, try waiting a moment and retrying, uninstalling and reinstalling the agent, or restarting your computer. If the problem persists, join the DingTalk group (ID: 44518739) to contact product and technical experts for assistance.

  5. After the agent is installed, go to the Agent Management page to check the agent connection status.

    If the agent status is Running, the agent is running correctly.

Enable, disable, or uninstall the agent

After installing the agent, you can enable, disable, or uninstall it as needed. Refer to the following instructions:

  • Linux server

    • Uninstall: Run sh uninstall.sh in the installation directory.

    • Enable: Run sh dbagent_start.sh in the installation directory.

    • Disable: Run sh dbagent_stop.sh in the installation directory.

  • Windows server

    • Uninstall: Run uninstall.bat in the installation directory.

    • Enable: Run dbagent_start.bat in the installation directory.

    • Disable: Run dbagent_stop.bat in the installation directory.

Next steps

After installing the agent, go to the Overview page of the Database Auditing console to view the security status of your database.

FAQ

For frequently asked questions about agent installation, see the following topics: