Updated on 2025-08-13 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 with 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 and click the target project name to access the project.
  2. Choose CICD > Deploy.
  3. On the Basic Resources tab page, click the name of the created cluster to go to the Target Hosts page.
  4. Click Add Host and select Adding IP for Add Hosts by or Importing ECS.
  5. 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

    Mandatory

    Description

    Host Name

    Yes

    Enter a custom agent host name.

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

    IP

    Yes

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

    OS

    Yes

    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 successful connectivity verification.

    Authorization

    Yes

    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

    Yes

    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.

    No

    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

    Mandatory

    Description

    Host Name

    Yes

    Enter a custom agent host name.

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

    IP

    Yes

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

    OS

    Yes

    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 successful connectivity verification.

    Authorization

    Yes

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

    Winrm Port

    Yes

    Port 5986 is recommended. You may customize the port.

  6. Select Importing ECS.

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

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

    • The ECS is running.
    • The ECS and host cluster have the same OS.
    • Agent host has a public IP (agent mode) when using a default agent pool.
    • The ECS has been imported as a target host. It cannot be imported as a proxy host.
    • You have configured the proxy host (proxy mode) before using the target host.

  7. 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.

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 a proxy, you need to add an ECS bound to an elastic IP address as the proxy.

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

Procedure

  1. Enable the SSH forwarding function of the proxy.

    • If the proxy mode is used, run the following command to check whether AllowTcpForwarding has been enabled for SSH on the proxy:
      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 proxy:

    1. Click in the upper left corner and choose Networking > to access the console.
    2. On the NAT Gateway console, click Buy Public NAT Gateway.
    3. Click Next. For details about the costs incurred during this process, see Billing Overview.
    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 > 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

      Set it to the public NAT gateway that you have added the SNAT rule to.

      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 proxy 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 following command with v6tov6.

    Table 4 Parameters

    Parameter

    Description

    ${proxy_ip}

    Private IP address of the agent.

    ${proxy_port}

    Listening port of the proxy, 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 proxy listening port, that is, ${proxy_port} in the preceding command. For details, see Configuring a Security Group.

Helpful Links