All Products
Search
Document Center

Simple Log Service:Install Logtail on ECS instances

Last Updated:Jan 16, 2024

Simple Log Service allows you to install Logtail on Alibaba Cloud Elastic Compute Service (ECS) instances. This topic describes how to specify ECS instances and install Logtail on the ECS instances in the wizard that is used to create a Logtail configuration.

Prerequisites

Simple Log Service implements automatic installation of Logtail on ECS instances based on Operation Orchestration Service (OOS). If you use a Resource Access Management (RAM) user to log on to the Simple Log Service console, make sure that the RAM user has management permissions on OOS and the Data Imported by Logtail module supported by Simple Log Service.

  • Simple Log Service

    In the Permission Assistant wizard, select Data Imported by Logtail. For more information, see Configure the permission assistant feature.

  • OOS

    • System permissions: AliyunOOSFullAccess.

      For more information about how to attach the AliyunOOSFullAccess policy to a RAM user, see Grant permissions to a RAM user.

    • Custom permissions: Create a custom policy that grants permissions to manage OOS resources based on the following example. For more information, see Create a custom policy.

      After the custom policy is created, attach the policy to the RAM user. For more information, see Grant permissions to a RAM user.

      {
          "Version": "1",
          "Statement": [
              {
                  "Effect": "Allow",
                  "Action": [
                      "ecs:DescribeTagKeys",
                      "ecs:DescribeTags",
                      "ecs:DescribeInstances",
                      "ecs:DescribeInvocationResults",
                      "ecs:RunCommand",
                      "ecs:DescribeInvocations"
                  ],
                  "Resource": "*"
              },
              {
                  "Effect": "Allow",
                  "Action": [
                      "oos:ListTemplates",
                      "oos:StartExecution",
                      "oos:ListExecutions",
                      "oos:GetExecutionTemplate",
                      "oos:ListExecutionLogs",
                      "oos:ListTaskExecutions"
                  ],
                  "Resource": "*"
              }
          ]
      }

Procedure

Note

Simple Log Service allows you to use Logtail to collect logs from ECS instances, servers that are deployed in self-managed data centers, and servers that are provided by third-party cloud service providers. Before you collect logs, you must install Logtail on your servers. 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 manually install Logtail on the server. For more information, see Install Logtail on a Linux server or Install Logtail on a Windows server.

  1. Log on to the Simple Log Service console.

  2. In the Import Data section, select Delimiter Mode - Text Log.

    Delimiter Mode - Text Log is used only as an example. You can select a different data source based on your business requirements.

  3. Select a project and a Logstore. Then, click Next.

  4. In the Create Machine Group step, click the ECS Instances tab.

  5. Specify ECS instances.

    You can use one of the following methods to specify ECS instances.

    Important

    Make sure that Cloud Assistant is installed on the ECS instances.

    By default, Cloud Assistant Agent is pre-installed on ECS instances that are created from public images after December 1, 2017. For ECS instances that are purchased before December 1, 2017, you must install Cloud Assistant Agent on the instances. For more information, see Install Cloud Assistant Agent.

    选择ECS实例

    Method

    Description

    Manually Select Instances

    You can select one or more ECS instances from the instance list to install Logtail.

    You can filter instances based on several conditions, including Region, Tag filtering, Status, Billing Method, and Network Type. You can also filter instances by entering a keyword.

    Specify Instance Tags

    You can add tags to ECS instances. This way, you can categorize and manage resources. For more information, see Create or add a tag. After you add tags, you can select one or more tags to specify instances. The system installs Logtail on all ECS instances to which the tags are added.

    A tag is a key-value pair. If you select only tag keys, the system installs Logtail on all ECS instances for which the tag keys are specified.

    Specify Resource Group

    You can configure resource groups for ECS instances to manage resources in a hierarchical manner. For more information, see Resource groups. After you configure resource groups, you can select a resource group to specify instances. The system installs Logtail on all ECS instances in the resource group.

    Upload CSV File

    You can export a resource list from the ECS console as a CSV file. After you export a resource list, you can upload the CSV file to specify instances. The system installs Logtail on all ECS instances in the list.

    Select All

    If you select this option, the system automatically installs Logtail on all ECS instances that belong to the current Alibaba Cloud account.

    Specify Inventory Conditions

    After you create a configuration list in OOS, you can use the configuration list to specify the ECS instances on which you want to install Logtail. For more information, see Use OOS to collect the data of ECS instances.

  6. Optional. Configure advanced settings.

    Parameter

    Description

    Description

    Enter a description for the installation task.

    Executed Resource Group

    Select the required resource group. After you select a resource group, the system adds the resource group information to the installation task.

    Execution Mode

    Select one of the following modes:

    • Automatic: If Logtail fails to be installed on a server, Simple Log Service attempts to install Logtail on the next available server.

    • Suspend upon Failure: If Logtail fails to be installed on a server, Simple Log Service attempts to install Logtail on the server again.

    Rate control type

    Select one of the following types:

    • Concurrency-based Control: Logtail is installed on the specified ECS instances at the same time.

    • Batch-based Control: Logtail is installed on the specified ECS instances in batches.

    Concurrency

    Specify the concurrency rate. The value can be a number or percentage. For example, if you set the Concurrency parameter to 2 Targets, Logtail is installed on two ECS instances at the same time.

    Note

    If you set the Rate control type parameter to Concurrency-based Control, you must configure this parameter.

    Batch Array

    Enter an array that specifies how Logtail is installed. Simple Log Service installs Logtail on the specified ECS instances in batches based on the array that you specify. Simple Log Service installs Logtail on the next batch of ECS instances only after Logtail is installed on the current batch of ECS instances. You can enter an array that consists of numbers or percentages. For example, If you set the Batch Array parameter to [1, 5%, 10%], Logtail is installed on one ECS instance in the first batch. In the second batch, Logtail is installed on 5% of the total instances. In the third and subsequent batches, Logtail is installed on 10% of the total instances.

    Note

    If you set the Rate control type parameter to Batch-based Control, you must configure this parameter.

    Error Threshold

    Specify the maximum number of errors or the maximum error rate that is allowed before the installation task is stopped. Default value: 0.

    For example, Logtail needs to be installed on four ECS instances. In this example, the Concurrency parameter is set to 1 Targets, and the Error Threshold parameter is set to 0 Errors. If Logtail fails to be installed on one of the ECS instances, the installation on the subsequent servers is canceled.

  7. Click Create.

  8. Confirm the settings and click OK.

    The following page appears. You can click Refresh to update the installation status.安装结果

  9. After Logtail is installed on the specified ECS instances, click Complete Installation.

What to do next

After Logtail is installed, you can perform the following operations based on your actual scenario:

References

Uninstall Logtail