All Products
Search
Document Center

Simple Log Service:Install Logtail on ECS instances

最終更新日:Jun 20, 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.

Limits

Simple Log Service can automatically install Logtail on an ECS instance only if the ECS instance resides in the same region as your project. If the ECS instance and the project reside in different regions, you must manually install Logtail on the ECS instance. In this case, the network type is Internet. For more information, see Install Logtail on a Linux server.

Prerequisites

Simple Log Service implements automatic installation of Logtail on ECS instances based on CloudOps 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 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 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 in data centers, and servers from 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 a different Alibaba Cloud account from Simple Log Service, a server in a data center, or a server from a third-party cloud service provider, 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 Quick Data Import section, click Import Data. In the Import Data dialog box, click Regular Expression - Text Logs.

    Regular Expression - Text Logs is used only as an example. You can select a different data source based on your business requirements.

    image

  3. In the Select Logstore step, configure Project and Logstore 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, configure the parameters.

    1. Select Servers for Scenario.

    2. Select ECS for Installation Environment.

    3. Click Create Machine Group next to Select Machine Group.

  5. Specify ECS instances.

    Important

    Make sure that Cloud Assistant Agent is installed on the ECS instances that you want to specify.

    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 instances. For more information, see Install Cloud Assistant Agent.

    In the Create Machine Group panel, select the ECS instances on which you want to install Logtail. You can also create ECS instances. For more information, see Create an ECS instance.

    image

  6. Click Install and Create Machine Group.

    If Success is displayed in the Logtail Installation Status column, Logtail is installed. If you want to select different ECS instances, click Recreate Installation Task. Then, go to Step 5 and select the instances.

    image

What to do next

Simple Log Service projects and servers belong to the same account and reside in the same region

The following figure shows the configuration process.

image

After Logtail is installed, you must create a machine group and specify a data source to configure Logtail. Then, you can use Logtail to collect logs. For more information, see Create an IP address-based machine group, Create a custom identifier-based machine group, and Collect text logs.

Simple Log Service projects and servers belong to different accounts and reside in the same region

The following figure shows the configuration process.

image

After Logtail is installed, you must create a user identifier file, configure a custom identifier in the file, create a machine group, and specify a data source to configure Logtail. Then, you can use Logtail to collect logs. For more information, see Configure a user identifier, Create a custom identifier-based machine group, Collect text logs, and Use Logtail to collect logs across Alibaba Cloud accounts.

Simple Log Service projects and servers reside in different regions

The following figure shows the configuration process.

image

You must install Logtail by using the installation command that is created for the Internet type. After you install Logtail, you must configure a user identifier, create a machine group, and specify a data source to configure Logtail. Then, you can use Logtail to collect logs. For more information, see Configure a user identifier, Create an IP address-based machine group, Create a custom identifier-based machine group, and Collect text logs.

Important

If you download Logtail over the classic network or a VPC, you can modify the network parameters in the ilogtail_config.json file to configure Logtail and collect logs across regions.

References

Uninstall Logtail