All Products
Search
Document Center

Simple Log Service:Introduction to machine groups

Last Updated:Nov 29, 2024

A machine group is a virtual group of multiple servers. Simple Log Service uses machine groups to manage the servers whose logs need to be collected by using Logtail. This topic describes the concept and types of machine groups.

Overview

image

Simple Log Service allows you to apply one Logtail configuration to multiple machine groups or apply multiple Logtail configurations to one machine group. If you want to collect data from multiple servers, you can categorize the servers into multiple machine groups by region or type and apply a Logtail configuration to a specific machine group. Simple Log Service delivers the Logtail configuration to all servers in the machine group to collect data from the servers.

Simple Log Service allows you to create a machine group by using IP addresses or custom identifiers. Creating an IP address-based machine group is easier compared with creating a custom identifier-based machine group. However, we recommend that you create a machine group by using custom identifiers because of the following benefits:

  • If the servers of your machine group reside in custom network environments such as virtual private clouds (VPCs), the IP addresses of the servers may conflict. In this case, Logtail fails to collect data. You can create a machine group by using custom identifiers to prevent this issue.

  • You can flexibly scale a machine group by using custom identifiers. If you configure the same custom identifier for new servers that you want to add to a machine group, Simple Log Service automatically identifies the custom identifier and adds the servers that have the same custom identifier to the machine group. If you no longer need to collect logs from a server, you can delete the custom identifier file on the server. This way, Simple Log Service automatically removes the server from the related machine group.

User identifier

The user identifier file contains the ID of your Alibaba Cloud account. The file specifies that the account is authorized to access the server on which Logtail is installed and collect logs from the server. For more information, see Configure a user identifier.

Important
  • If you want to collect logs from an Elastic Compute Service (ECS) instance that belongs to another Alibaba Cloud account, a server that is deployed in a self-managed data center, or a server that is provided by a third-party cloud service provider, you must configure a user identifier for your server.

  • You must specify the ID of an Alibaba Cloud account as a user identifier in the user identifier file. You cannot specify the ID of a Resource Access Management (RAM) user as a user identifier.

  • You must specify the name of the user identifier file. You do not need to specify the file extension.

  • You can specify multiple user identifiers for a server. However, you can specify only one user identifier for a Logtail container.

IP address-based machine group

You can specify the IP addresses of servers in a machine group to add multiple servers to the machine group.

  1. If you use an Elastic Compute Service (ECS) instance and do not configure the hostname or change the network type, you can specify the private IP address of the ECS instance in a machine group.

  2. In other cases, you must specify the IP addresses that are automatically obtained by Logtail in a machine group. The IP addresses are recorded in the ip field of the app_info.json file of a server. The following list describes how Logtail obtains the IP address of a server:

    1. If the hostname-to-IP address mapping is configured in the /etc/hosts file of the server, Logtail obtains the mapped IP address.

    2. If the hostname-to-IP address mapping is not configured in the /etc/hosts file of the server, Logtail obtains the IP address of the first network interface card (NIC) of the server.

Custom identifier-based machine group

In most cases, a system consists of multiple modules. You can scale out each module by adding additional servers to a module. To improve the efficiency of collecting and classifying logs, we recommend that you create a machine group for each module. You must configure the same user identifier for the servers of a specific module to ensure that the servers of a module belong to the machine group created for the module.

For example, a website consists of an HTTP request processing module, a cache module, a logic processing module, and a storage module. You can configure the following user identifiers for the servers of the modules: http_module, cache_module, logic_module, and store_module.

References