tencent cloud

Cloud Log Service

Machine Group

Download
Focus Mode
Font Size
Last updated: 2026-06-09 19:05:38

Scenarios

A machine group is a server object from which LogListener collects logs in Tencent Cloud Log Service (CLS). You configure the servers for LogListener to collect logs from by using machine groups. Typically, you can create different machine groups for different business scenarios to facilitate your management of the log service.

Creating a Machine Group

Creating a machine group by machine group IP

1. Log in to the Cloud Log Service console.
2. Click Machine Group Management in the left sidebar.
3. Select the region of your CLS, such as Guangzhou, and then click Create Machine Group.
4. Configure the following information in the pop-up window.

Machine Group Name: For example, cls_test.
System: Please select the system environment of the machine to join the group. Support select Windows or Linux.
Type: select Machine group IP.
IP: manually input the machine IP address to add to the machine group.
Note:
LogListener must be installed on the associated machines. For details, see the LogListener Installation Guide (Linux) or the LogListener Installation Guide (Windows).
Only one IP address can be entered per line.
The IP address you enter must match the `group_ip` in the /etc/loglistener.conf file under the machine's LogListener installation directory.
If a machine is configured with a machine id, you can only create a machine group via machine id and cannot use IP addresses. You can determine whether a machine has a machine id configured by checking whether the `group_label` field in the /etc/loglistener.conf file under the machine's LogListener installation directory is left empty.
LogListener Auto Upgrade: Enabled by default and can be configured according to actual requirements.
Note:
If your server is associated with multiple machine groups, as long as LogListener Auto Upgrade is enabled for one of these machine groups, this server will undergo automatic upgrade.
LogListener offline removal policy: see machine offline auto-exclusion.
LogListener Service Logs: LogListener service logs are enabled by default, recording important logs such as LogListener running status and collection state. For details, see LogListener service logs.
Tag: Machine group resource tag for resource management.
Machine group metadata: Metadata can be used to distinguish logs. For details, see custom metadata.
5. Click OK to complete the creation.

Creating a machine group by machine ID

Since each time the IP changes requires modifying the corresponding machine group configuration, configuring machine groups with machine IPs is relatively complex if your machine IP address changes frequently.
CLS supports dynamic configuration of machine groups by machine identification. Only fill in the machine identification in the LogListener configuration message, and CLS will recognize and automatically add machines to machine groups.
Note:
Creating a machine group by configuring a machine id is only supported for LogListener version 2.3.0 and above. For upgrade details, see the LogListener Upgrade Guide.
1. Log in to the Cloud Log Service console.
2. Click Machine Group Management in the left sidebar.
3. Select the region of your CLS, such as Guangzhou, and then click Create Machine Group.
4. Configure the following information in the pop-up window.

Machine Group Name: For example, cls_test.
System: Please select the system environment of the machine to join the group. Support select Windows or Linux.
Type: select Machine label.
Machine Iabel: enter machine Identification.
Note:
LogListener must be installed on the associated machines. For details, see the LogListener Installation Guide (Linux) or the LogListener Installation Guide (Windows).
LogListener Auto Upgrade: Enable LogListener auto upgrade. For details, see LogListener Upgrade Guide.
Note:
If your server is associated with multiple machine groups, as long as LogListener Auto Upgrade is enabled for one of these machine groups, this server will undergo automatic upgrade.
LogListener offline removal policy: see machine offline auto-exclusion.
LogListener Service Logs: LogListener service logs are enabled by default, recording important logs such as LogListener running status and collection state. For details, see LogListener service logs.
Tag: Machine group resource tag for resource management.
Machine group metadata: Metadata can be used to distinguish logs. For details, see custom metadata.
5. Click OK.
6. Log in to the target machine configured with a machine id, and run the following command to open the /etc/loglistener.conf file in the LogListener installation directory. The installation directory is /usr/local in this example.
vi /usr/local/loglistener/etc/loglistener.conf
7. Press the i key to enter edit mode.
8. Find the group_label parameter, and enter your custom machine identifications and separate them with a comma (multiple identifications are separated by commas).



9. Press the Esc key to exit edit mode, input :wq, and press the Enter key to save the settings.
10. Run the following command, restart LogListener to complete the creation.
Executed by systemd
Not executed by systemd
Applicable to LogListener 2.8.3 or later, and with systemd in the operating system.
systemctl restart loglistenerd
Run /etc/init.d/loglistenerd check to check whether the restart is successful.



Applicable to LogListener 2.8.3 or earlier, or LogListener 2.8.3 or later, but without systemd in the operating system.
/etc/init.d/loglistenerd restart
Return sample of successful reboot




Viewing Machine Status

A machine group uses the heartbeat mechanism to maintain its connection with the CLS system. A machine group that has successfully installed the LogListener will send a heartbeat to the CLS at regular intervals.
1. Log in to the Cloud Log Service console.
2. Click Machine Group Management in the left sidebar.
3. On the machine group management page, find the machine group you need to operate and click View.
4. View the machine group status in the pop-up window.
5. Check the machine group status to see if it works normally. If it works normally, it indicates that your server can communicate with Tencent Cloud Log Service normally.

Automatic Removal for Offline Machines

For a machine group associated via machine id, if a machine goes offline, it will be automatically removed from the machine group and disassociated by default after being offline for 30 days. To shorten the offline removal period, follow these steps:
1. Log in to the Cloud Log Service console.
2. Click Machine Group Management in the left sidebar.
3. Select the region where CLS is located, such as Guangzhou.
4. Click Create Machine Group, or select an existing machine group and click Edit.
5. Find the LogListener offline removal policy configuration item, and modify the machine offline cycle by setting the number of days.




Deleting machine group

1. Log in to the Cloud Log Service console.
2. Click Machine Group Management in the left sidebar.
3. On the machine group management page, select the machine group to delete, and choose More > Delete.
4. In the pop-up prompt window, click OK to complete machine group deletion.
Note:
Once a server group is deleted, its associated log topics will no longer be able to collect logs.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback