A machine group is a server object configured to collect logs by LogListener of CLS. You can configure machine groups through the CLS console, and categorize them by use cases.
Log in to the CLS console.
Click Machine Group in the left sidebar.
Select the region of your CLS, such as Guangzhou, and then click Create Machine Group.
Configure the following information in the pop-up:
cls_test
for example.Note:
- Enter one IP per line. Do not enter IPs of Windows machines.
- If you are using Tencent Cloud machines in the same region, you can enter private IPs directly, with one IP per line.
- If you are using machine groups of different regions, enter public IPs.
Click OK.
If your machine IPs change frequently, you need to modify machine group configuration once the IPs change.
To avoid the trouble, you can use CLS to configure machine groups dynamically by machine ID. You just need to enter the machine IDs when configuring LogListener, CLS will recognize and add these machines into the machine group automatically.
Note:Configuring machine groups by machine ID is supported only on LogListener v2.3.0 and above. You need to upgrade lower versions manually to use this feature.
Log in to the CLS console.
Click Machine Group in the left sidebar.
Select the region of your CLS, such as Guangzhou, and then click Create Machine Group.
In the pop-up, configure the following items:
cls_test
for exampleNote:Enter one machine ID per line, and do not enter Windows machine IDs.
Click OK.
Log in to a machine added above, run the following command, open the /etc/loglistener.conf
file under the installation directory of LogListener.
Take the /user/local
installation directory as an example:
vi /usr/local/loglistener-2.3.0/etc/loglistener.conf
Press i to enter the edit mode.
Find the group_label
parameter, and enter your custom machine IDs and separate them with a comma (,).
Press Esc to exit the edit mode.
Enter :wq, and press Enter to save the settings.
Run the following command, restart LogListener, and then the machine group will be created.
/etc/init.d/loglistenerd restart
A machine group uses the heartbeat mechanism to maintain its connection with the CLS system. A machine group with LogListener installed regularly sends heartbeats to CLS.
Log in to the CLS console.
Click Machine Group in the left sidebar.
Find the target machine group, click View.
View the machine group status in the pop-up.
You can view the machine group status to see if it works normally. If so, your server can communicate with CLS normally.
Log in to the CLS console.
Click Machine Group in the left sidebar.
Find the target machine group, click Delete.
In the pop-up, click OK.
Note:Once the machine group is deleted, logs will no longer be collected under its associated log topics.
Was this page helpful?