This topic describes how to batch install or batch update Logtail by using Alibaba Cloud Operation Orchestration Service (OOS).
Scenarios
OOS is a platform that allows you to create custom templates or use the public templates provided by Alibaba Cloud to automate O&M operations on the resources of Alibaba Cloud services, including Elastic Compute Service (ECS), ApsaraDB RDS, Server Load Balancer (SLB), and Virtual Private Cloud (VPC). For more information, see What is OOS?
If you want to install, update, or uninstall Logtail on a large number of ECS instances, you can use OOS to automate batch operations. 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.
Prerequisites
At least one ECS instance is deployed.
If you use a Resource Access Management (RAM) user to install Logtail on ECS instances, the RAM user must have the following permissions:
AliyunOOSFullAccess permission: For more information about how to grant the AliyunOOSFullAccess permission to a RAM user, see Grant permissions to a RAM user.
Custom permissions: To grant the following custom permissions to a RAM user, you must create a custom policy and attach the custom policy to the RAM user. For more information, see Create a custom policy and 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
Log on to the OOS console.
In the left-side navigation pane, choose Automated Task > Public Template.
On the Public Templates page, enter LogAgent in the search box, find the ACS-ECS-BulkyInstallLogAgent template, and then click Create Execution.
On the Create page, perform the following operations:
In the Basic Information step, retain the default settings and click Next Step: Parameter Settings.
In the Parameter Settings step, configure the following parameters and click Next Step: OK.
Overwrite: If you turn on Overwrite, the configurations of Logtail are overwritten if Logtail is already installed on your ECS instances. The following table describes the parameter.
ImportantIf your ECS instances run a Windows operating system and you want to update Logtail that is installed on the ECS instances, only the original configurations of Logtail can be overwritten. The Overwrite parameter does not take effect.
Overwrite
Install
Update
Uninstall
On
Uninstall Logtail and install the latest version.
Uninstall Logatil and install the latest version.
Uninstall Logtail.
Off
The system returns a message indicating that Logtail already exists and is not overwritten.
Retain the original configurations of Logtail and install the latest version. After Logtail is installed, collect logs based on the previous progress.
Uninstall Logtail.
TargetInstance: Select your ECS instances. For more information, see Install Logtail on ECS instances.
Confirm the preceding settings and click Create.
View the execution result.
In the execution result section, you can view the execution status of the Logtail installation command on each ECS instance.
You can obtain information such as the installation directory of Logtail on the export and log tabs.