All Products
Search
Document Center

Simple Log Service:Overview

Last Updated:Apr 26, 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 and how to configure a machine group.

Background information

image
  • Simple Log Service allows you to collect data from multiple servers by using the same Logtail configuration. The servers can belong to a single machine group or multiple machine groups. After you apply a Logtail configuration to a machine group, Simple Log Service delivers the Logtail configuration to all servers in the machine group to collect data from the servers.

  • You can perform the following steps to add a server to a machine group:

    1. Configure a user identifier for the server. For more information, see Configure a user identifier. If the Simple Log Service project and Elastic Compute Service (ECS) instance that are used belong to the same Alibaba Cloud account, you do not need to configure a user identifier. For more information, see Quick reference.

    2. Create an IP address-based machine group or a custom identifier-based machine group.

User identifier

If your server is an ECS instance that belongs to a different Alibaba Cloud account from Simple Log Service, a server from a third-party cloud service provider, or a server in a data center, you must use Logtail to collect logs from the server. You must install Logtail on your server, specify the ID of the Alibaba Cloud account to which your Simple Log Service project belongs as a user identifier on the server, and then grant the account the permissions to collect logs from the server by using Logtail. If you do not configure a user identifier on the server, the heartbeat status of the server may be displayed as failure in the machine group to which the server is added. As a result, Logtail cannot collect or send logs to Simple Log Service.

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 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

You can specify the custom identifier of servers in a machine group to add multiple servers to the machine group. This method provides the following advantages:

  • If your servers reside in multiple custom network environments such as virtual private clouds (VPCs), the IP addresses of some servers may conflict. In this case, Simple Log Service cannot manage Logtail. You can create a custom identifier-based machine group to prevent this issue.

  • You can flexibly scale a machine group by configuring the same custom identifier for multiple servers. If you configure the same custom identifier for new servers that you want to add to a machine group, Simple Log Service identifies the custom identifier and adds the servers that have the same custom identifier to the 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.