All Products
Search
Document Center

Simple Log Service:Install Logtail on ECS instances

Last Updated:Feb 24, 2025

Simple Log Service can install Logtail on Elastic Compute Service (ECS) instances that reside in the same region as your Simple Log Service project. 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.

Important

This topic applies only to scenarios where the ECS instance and Simple Log Service project are in the same account and region. If this condition is not met, refer to Install Logtail on a Linux server or Install Logtail on a Windows server.

Prerequisites

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 CloudOps Orchestration Service (OOS) and the Logtail-based Data Collection module supported by Simple Log Service.

  • Simple Log Service

    In the Permission Assistant wizard, select Logtail-based Data Collection. For more information, see Configure the permission assistant feature.

  • OOS: Simple Log Service utilizes OOS to automatically install Logtail on ECS instances.

    • 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 custom policies.

      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": "*"
              }
          ]
      }

Install Logtail

  1. Log on to the Simple Log Service console.

  2. In the Import Data section, search by Text Logs and click one of the cards that are displayed. In this example, click Multi-line - Text Logs.

    image

  3. In the Select Logstore step, configure the Project and Logstore parameters and click Next.

    If you want to create a project and a logstore, click Create Now. For more information, see Manage a project and Manage a logstore.

  4. In the Machine Group Configurations step, set the Scenario parameter to Servers and the Installation Environment parameter to ECS, and click Create Machine Group in the Select Machine Group section. In the Create Machine Group panel, select the ECS instances on which you want to install Logtail and click Install and Create Machine Group.

    Important

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

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

    image

  5. If Success is displayed in the Logtail Installation Status column, Logtail is installed. If Logtail fails to be installed, click Recreate Installation Task.

    image

Upgrade Logtail

If you want to upgrade Logtail on a large number of ECS instances, you can use OOS to automate batch operations. For more information, see Use OOS to batch install or batch update Logtail.

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. For more information, see Install Logtail on a Linux server or Install Logtail on a Windows server.

Uninstall Logtail

Obtain the value for the ${region_id} variable based on the region where your Simple Log Service project resides. Replace the ${region_id} variable with the value that is obtained and uninstall Logtail.

Important

For more information about the value of the ${region_id} parameter for each region, see Supported regions. For example, the value of the ${region_id} parameter for the Singapore region is ap-southeast-1.

wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod +x logtail.sh; ./logtail.sh uninstall

What to do next

You can create a Logtail configuration in Simple Log Service. For more information, see Collect text logs from servers.