Log Service allows you to define a machine group by using IP addresses. This topic describes how to create an IP address-based machine group in the Log Service console.

Prerequisites

  • A project and a Logstore are created. For more information, see Create a project and a Logstore.
  • At least one server is available.
    • If you use an Elastic Compute Service (ECS) instance, you must make sure that the ECS instance belongs to the same Alibaba Cloud account and region as your Log Service.
    • If you use an ECS instance that belongs to a different Alibaba Cloud account from your Log Service, you must configure a user identifier before you create a machine group. This also applies if you use a server in a data center or from a third-party cloud service provider. For more information, see Configure a user identifier.
  • Logtail is installed on the servers. For more information, see Install Logtail on ECS instances.

Procedure

  1. Obtain the IP addresses of servers.
    The IP addresses that are obtained by Logtail are recorded in the ip field of the app_info.json file.
    On the servers where Logtail is installed, you can go to the following paths to view the app_info.json file:
    • Linux: /usr/local/ilogtail/app_info.json
    • 64-bit Windows: C:\Program Files (x86)\Alibaba\Logtail\app_info.json
    • 32-bit Windows: C:\Program Files\Alibaba\Logtail\app_info.json

    The following figure shows how to view the IP address of a Linux server.

    IP address
  2. Log on to the Log Service console.
  3. In the Projects section, click the project.
  4. In the left navigation sidebar, choose Resources > Machine Groups.
  5. On the right of Machine Groups, choose Machine Groups > Create Machine Group.
  6. In the Create Machine Group panel, configure the parameters and click OK. The following table describes the parameters.
    Parameter Description
    Name Specify the name of the machine group. The name must be 3 to 128 characters in length, and can contain only lowercase letters, digits, hyphens (-), and underscores (_). The name must start and end with a lowercase letter or a digit.
    Notice After 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 differentiate the logs that are generated by different servers. For more information, see Log topics.
    IP Addresses Enter the IP addresses of servers that you obtain in Step 1.
    Note
    • If you want to add multiple servers to the machine group, separate the IP addresses with line feeds.
    • Do not add Windows and Linux servers to the same machine group.
    After you create the machine group, the machine group takes effect after approximately 2 minutes.
  7. View the status of the machine group.
    1. In the Machine Groups list, click the machine group that you create.
    2. On the Machine Group Settings page, view the server details and machine group status.
      If a value in the Heartbeat column is OK, the server is connected to Log Service. If the value is FAIL, the connection failed. For more information, see What do I do if no heartbeat connections are detected on Logtail? View the machine group status