Updated on 2026-01-21 GMT+08:00

Adding an Agent Host to a Host Cluster

To resolve communication issues in complex networks, it is necessary to add one or more agent hosts to the host cluster. This section describes how to add an agent host to a host cluster.

Prerequisites

  • A host cluster is available. You have the permission to add hosts to the cluster.
  • A host bound to a public IP address is available. (If you do not have a host, purchase one by referring to Purchasing an ECS in Custom Config Mode.)

Adding an Agent Host

  1. Go to the CodeArts homepage.

    1. Log in to the CodeArts console, click , and select a region where you have enabled CodeArts.
    2. Click Go to Workspace.

      If your account uses the old billing mode (see Old Billing Modes), click Access Service.

  2. Click the target project name to go to the project.
  3. Choose CICD > Deploy.
  4. On the Basic Resources tab page, click the name of the created cluster to go to the Target Hosts page.
  5. Click Add Host and select Adding IP for Add Hosts by or Importing ECS.
  6. Select Adding IP.

    Select Agent for Host Connection Mode to add an agent host. Enter the following information and click OK.
    Table 1 Parameters of the agent host (Linux)

    Parameter

    Description

    Host Name

    Enter a custom agent host name.

    Enter 3 to 128 characters. Use digits, letters, hyphens (-), underscores (_), and periods (.).

    IP

    Enter the public IP address bound to the agent host. IPv4 or IPv6 address is supported.

    OS

    The default value is the OS of the current host cluster and cannot be changed.

    Configure the target host by referring to Configuring a Linux Host to ensure the successful connectivity verification.

    Authorization

    Select Password or Key for authentication as required.

    • If you select Password, the Username and Password are displayed. Take ECS as an example. Enter the ECS username and password.
    • If you select Key, the Username and Key are displayed. For details about how to generate and obtain a key, see Obtaining the Linux key.

    SSH Port

    Port 22 is recommended. You may customize the port.

    Install AOM ICAgent for metric monitoring, log query, and alarm functions on Huawei Cloud Linux hosts. Configure an agency before installation.

    If the checkbox is selected, you can install and use AOM-ICAgent on your hosts for free for metric monitoring, log query, and alarm functions. ICAgent applies only to Huawei Cloud Linux hosts. Before installing ICAgent, configure an agency by referring to Creating an Agency.

    Table 2 Parameters of the agent host (Windows)

    Parameter

    Description

    Host Name

    Enter a custom agent host name.

    Enter 3 to 128 characters. Use digits, letters, hyphens (-), underscores (_), and periods (.).

    IP

    Enter the public IP address bound to the agent host. IPv4 or IPv6 address is supported.

    OS

    The default value is the OS of the current host cluster and cannot be changed.

    Configure the target host by referring to Configuring the Host Running Windows to ensure the successful connectivity verification.

    Authorization

    Windows proxies support only password authentication. Take ECS as an example. Enter the ECS username and password.

    Winrm Port

    Port 5986 is recommended. You may customize the port.

  7. Select Importing ECS.

    To add your Huawei Cloud ECS as the agent host, click Add Host, and select Importing ECS for Add Hosts by.

    The following requirements are mandatory for you to import the purchased ECS:

    • ECS is running.
    • ECS and the host cluster have the same OS.
    • When using an official agent pool, the agent host must have a public IP address.
    • The ECS has been imported as a target host. It cannot be imported as an agent host.
    • In the agent mode, configure the agent host before using the target host.
    • Importing an ECS (host)

      Click Import in the row where the ECS is located. On the displayed page, set the parameters for the Linux and Windows hosts by referring to step 6.

    • Importing ECSs (hosts) in batches

      Select the ECSs to be imported and click Import Selected in the lower part. On the displayed page, set the parameters for the Linux and Windows hosts by referring to step 6.

      After the configuration, click next to the parameter to fill down it to the hosts listed underneath.

  8. Verify the host connectivity.

    After the host is created, the system automatically verifies the connectivity. If Successful is displayed, the verification is successful. If the connectivity verification fails, click Failed and rectify the fault based on the failure cause and click View Solution displayed in the dialog box.

    For details about connectivity verification, see Host Management.

Configuring Agent Hosts of Different Systems

CodeArts Deploy supports adding Linux and Windows agent hosts. The following sections describe how to configure them.

Required Resources

You have configured the following resources in a Virtual Private Cloud (VPC):

Resource Type

Supported Resource Specifications

Quantity

Description

EIP

Bandwidth ≥ 5 Mbit/s

2

1. When creating an agent, you need to add an ECS bound to an elastic IP address as the agent.

2. When creating an SNAT gateway, you need to bind an EIP to it.

Procedure

  1. Enable the SSH forwarding function of the agent.

    • If the agent mode is used, run the following command to check whether AllowTcpForwarding has been enabled for SSH on the agent:
      grep AllowTcpForwarding "/etc/ssh/sshd_config"
    • If the value of this attribute is no, set it to yes.
      AllowTcpForwarding yes
    • Run the following command to restart the sshd service:
      service sshd restart

  2. Configure SNAT for the agent:

    1. Click in the upper left corner and choose Networking > NAT Gateway to access the console.
    2. On the NAT Gateway console, click Buy Public NAT Gateway.
    3. Click Next. You may be charged during the process. For details, see NAT Billing.
    4. After the NAT gateway is created, return to the NAT gateway list and click the target NAT gateway.
    5. Click the SNAT Rules tab, click Add SNAT Rule, and enter the related configuration.
    6. Click OK. The SNAT service is configured.

  3. Check routing policies.

    1. Go to the console. In the upper left corner of the page, click and choose Networking > Virtual Private Cloud to access the network console.
    2. Choose Virtual Private Cloud > Route Tables and click the target route table.

      Check the route information.

      Table 3 Description of route information

      Route Information

      Description

      Destination

      Destination CIDR block. The default value is 0.0.0.0/0. Select the IP address for the access environment based on project requirements.

      IP Addresses

      Click to check detailed information about the IP addresses.

      Next Hop Type

      Set it to NAT gateway.

      Next Hop

      Gateway instance of the SNAT rule.

      Type

      System: A system route is automatically added by the system and cannot be modified or deleted.

      Custom: A user-defined route is added by a user to direct traffic to a desired destination, and can be modified and deleted. The destination of a custom route cannot overlap with that of a system route.

      Description

      Description of the route.

      Operation

      You can modify and delete routes.

Required Resources

  • A Windows host is available.
  • The network connection between the agent and hosts is normal.

Procedure

  1. Go to the agent, open the PowerShell window, and run the netsh command, as shown in the following figure.

    • Replace the parameters as follows:
      netsh interface portproxy add v4tov4 listenaddress=${proxy_ip}  listenport=${proxy_port}  connectaddress=${host_ip}  connectport=${host_port}

      For IPv6 hosts, replace v4tov4 in the above command with v6tov6.

    • Run the following command to check whether the settings take effect:
      netsh interface portproxy show all
    • If the agent information is incorrect, run the following command to clear the information:
      netsh interface portproxy delete v4tov4  listenaddress=${proxy_ip} listenport= ${proxy_port} protocol=tcp
    Table 4 Parameters

    Parameter

    Description

    ${proxy_ip}

    Private IP address of the agent.

    ${proxy_port}

    Listening port of the agent, for example, 54.

    ${host_ip}

    Private IP address of the host.

    ${host_port}

    Port of the host. Generally, the port is 5986.

  2. Enable the agent listening port, that is, ${proxy_port} in the preceding command. For details, see Configuring a Security Group.

Helpful Links