If you want to collect logs from servers, you must create a machine group and add the servers to the machine group. Simple Log Service allows you to create a machine group by using IP addresses. This topic describes how to create an IP address-based machine group.
Prerequisites
A project and a Logstore are created. For more information, see Create a project and Create a Logstore.
Logtail is installed. For more information, see Install Logtail on a Linux server and Install Logtail on a Windows server. If you use an Elastic Compute Service (ECS) instance that belongs to the same Alibaba Cloud account and region as your Simple Log Service project, you can install Logtail by following the instructions provided in Install Logtail on ECS instances.
A user identifier is configured. If you use an ECS instance that belongs to the same Alibaba Cloud account as your Simple Log Service project, you do not need to configure a user identifier.
Procedure
You can collect logs to Simple Log Service over an internal network of Alibaba Cloud only if you use an ECS instance and select the network type of Alibaba Cloud internal network when you install Logtail on the instance. An internal network refers to the classic network or a virtual private cloud (VPC).
Obtain the IP addresses of servers.
Log on to each server on which Logtail is installed.
Open the app_info.json file.
The following table describes the paths to the app_info.json file.
Operating system
Logtail
Path to the app_info.json file
Linux
Logtail for 64-bit Windows
/usr/local/ilogtail/app_info.json
64-bit Windows
Logtail for 64-bit Windows
C:\Program Files\Alibaba\Logtail\app_info.json
Logtail for 32-bit Windows
C:\Program Files (x86)\Alibaba\Logtail\app_info.json
32-bit Windows
Logtail for 32-bit Windows
C:\Program Files\Alibaba\Logtail\app_info.json
View the value of the
ip
field in the app_info.json file.The value of the
ip
field indicates the IP addresses that are obtained by Logtail. The following figure shows the value of the ip field.
Log on to the Simple Log Service console.
In the Projects section, click the project that you want to manage.
In the left-side navigation pane, choose .
On the right side of Machine Groups, choose .
In the Create Machine Group panel, configure the following parameters and click OK.
Parameter
Description
Name
Enter the name of the machine group.
ImportantAfter the machine group is created, you cannot change the name of the machine group. Proceed with caution.
Identifier
Select IP Addresses.
Topic
Specify the topic of the machine group. The topic is used to identify the logs that are generated by different servers. For more information, see Log topics.
IP Addresses
Enter the IP addresses of servers that you obtained in Step 1.
ImportantIf you want to add multiple servers to the machine group, manually enter the IP addresses of the servers and separate the IP addresses with line feeds.
Do not add Windows and Linux servers to the same machine group.
View the status of the machine group.
In the Machine Groups list, click the machine group that you want to manage.
On the Machine Group Settings page, view the server details and machine group status.
If the value in the Heartbeat column for a server is OK, Logtail on the server is connected to Simple Log Service. If the value is FAIL, Logtail on the server is not connected. For more information about how to troubleshoot the issue, see How do I troubleshoot an error that is related to a Logtail machine group in a host environment?
ImportantThe creation process of a machine group requires approximately 2 minutes to complete. If the creation process is not complete, the heartbeat status is FAIL. In this case, click Refresh 2 minutes after you create the machine group.