A server group is a server object configured to collect logs by LogListener in Tencent Cloud CLS. Generally, different server groups are configured based on various business scenarios to help you manage CLS.
You can quickly create a server group on the CLS Console as instructed below:
Enter the server group name and the server IP address, and click OK after confirmation to complete the creation of the server group.
- Enter one IP in a line. Windows system is not supported.
- If you are using Tencent Cloud servers in the same region, you can enter private IPs directly, with one IP per line.
If you choose server IP address to configure a server group, you have to modify the configuration each time when one server IP address changes, which is annoying. However, CLS supports dynamically configuring the server group by server ID. You only need to fill in the server ID in the configuration information of Loglistener, and CLS can identify and automatically add the server to the server group.
- This feature is only supported by Loglistener 2.3 and later versions. If you use an earlier version, see installation guide to manually update it.
- Enter one server ID in a line. Windows system is not supported.
Enter the server group name and the server ID, and click OK after confirmation to complete the creation of the server group.
Log in to the target server and modify the
/etc/loglistener.conf file in the Loglistener installation directory (
/user/local in this example):
Press i on the keyboard to enter the edit mode.
Replace the information after
group_label with your server IDs separated by comma.
Press Esc, enter :wq and press Enter to save and close the file.
Run the following command to restart LogListener.
A server group uses the heartbeat mechanism to maintain its connection with the CLS system. The server group with LogListener installed regularly sends heartbeat to CLS.
Once the server group is deleted, logs are no longer collected under the associated log topics.