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.

Prerequisites

  • A project and a Logstore are created. For more information, see Create a project and Create a Logstore.
  • At least one server is available.
  • Logtail is installed on each server.
    • If you use an Elastic Compute Service (ECS) instance, make sure that the ECS instance belongs to the Alibaba Cloud account for which Log Service is activated and resides in the same region as your Log Service resources. For more information, see Install Logtail on ECS instances.
    • If your server is an ECS instance that belongs to another Alibaba Cloud account, a server that is provided by a third-party cloud service provider, or a server that is deployed in a self-managed data center, you must select a network based on your business requirements and install Logtail on the server. For more information, see Install Logtail on a Linux server and Install Logtail on a Windows server.
      Important If your server is an ECS instance that belongs to another Alibaba Cloud account, a server that is provided by a third-party cloud service provider, or a server that is deployed in a self-managed data center, you must configure a user identifier for the server. For more information, see Configure a user identifier.

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.
    To view the app_info.json file, go to the following paths on the servers on which Logtail is installed:
    • 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 that you want to view.
  4. In the left-side navigation pane, choose Resources > Machine Groups.
  5. On the Machine Groups tab, 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.
    ParameterDescription
    NameThe name of the machine group.
    Important After the machine group is created, you cannot change the name of the machine group. Proceed with caution.
    IdentifierThe identifier of the machine group. Select IP Addresses.
    TopicThe 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 AddressesThe server IP addresses that you obtained in Step 1.
    Important
    • To add multiple servers to the machine group, separate the IP addresses with line feeds.
    • We recommend that you do not add Windows and Linux servers to the same machine group.
  7. View the status of the machine group.
    1. In the Machine Groups list, click the machine group.
    2. On the Machine Group Settings page, view the server details and machine group status.
      If OK is displayed in the Heartbeat column of the machine group, Logtail that is installed on each server in the machine group is connected to Log Service. If the status is FAIL, see What do I do if a Logtail machine group has no heartbeats?
      Important The creation process of a machine group requires approximately 2 minutes to complete. If the creation process does not complete, the heartbeat status is FAIL. In this case, click Refresh 2 minutes after you create the machine group.
      View the status of a machine group