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
- Go to the CodeArts homepage and click the target project name to access the project.
- Choose CICD > Deploy.
- On the Basic Resources tab page, click the name of the created cluster to go to the Target Hosts page.
- Click Add Host and select Adding IP for Add Hosts by or Importing ECS.
- 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.
- 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.
- 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
- 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
- If the proxy mode is used, run the following command to check whether AllowTcpForwarding has been enabled for SSH on the proxy:
- Configure SNAT for the proxy:
- Click
in the upper left corner and choose Networking > to access the console.
- On the NAT Gateway console, click Buy Public NAT Gateway.
- Click Next. For details about the costs incurred during this process, see Billing Overview.
- After the NAT gateway is created, return to the NAT gateway list and click the target NAT gateway.
- Click the SNAT Rules tab, click Add SNAT Rule, and enter the related configuration.
- Click OK. The SNAT service is configured.
- Click
- Check routing policies.
- Go to the console. In the upper left corner of the page, click
and choose Networking > to access the network console.
- 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.
- Go to the console. In the upper left corner of the page, click
Required Resources
- A Windows host is available.
- The network connection between the proxy and hosts is normal.
Procedure
- 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.
- Enable the proxy listening port, that is, ${proxy_port} in the preceding command. For details, see Configuring a Security Group.
Helpful Links
- For details about APIs related to host clusters, see Host Management.
- For details about connectivity verification, see Host Management.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot