All Products
Search
Document Center

Simple Log Service:Install Logtail on ECS instances

Last Updated:Dec 05, 2024

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.

Limits

Simple Log Service can automatically install Logtail on ECS instances only when the ECS instances belong to the same Alibaba Cloud account and reside in the same region as your Simple Log Service project. If the ECS instances belong to a different Alibaba Cloud account or reside in a different region from your Simple Log Service project, you must manually install Logtail on the ECS instances. For more information, see Install Logtail on a Linux server and Install Logtail on a Windows server.

Prerequisites

Simple Log Service automatically installs 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 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

    • 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

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 China (Hangzhou) region is cn-hangzhou.

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.