This topic describes how to install, update, and uninstall Logtail on a Linux server.
Prerequisites
- At least one Linux server is available.
- The type of the network that is required to collect logs is determined. You can determine the network type based on the type of the server on which you want to install Logtail and the region where the server resides. For more information, see Select a network type.
Supported operating systems
- You can install Logtail on servers that run one of the following x86-64 Linux operating
systems:
- Alibaba Cloud Linux 2
- Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7, and Red Hat Enterprise Linux 8
- CentOS Linux 6, CentOS Linux 7, and CentOS Linux 8
- Debian GNU/Linux 8, Debian GNU/Linux 9, Debian GNU/Linux 10, and Debian GNU/Linux 11
- Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, and Ubuntu 20.04
- SUSE Linux Enterprise Server 11, SUSE Linux Enterprise Server 12, and SUSE Linux Enterprise Server 15
- openSUSE Leap 15.1, openSUSE Leap 15.2, and openSUSE Leap 42.3
- Linux operating systems based on GNU C Library version 2.5 or later
- You can install Logtail on servers that run one of the following ARM64 Linux operating
systems:
- Alibaba Cloud Linux 3.2 for ARM
- Anolis OS 8.2 for ARM or later
- CentOS Linux 8.4 for ARM
- Ubuntu 20.04 for ARM
- Debian GNU/Linux 11.2 for ARM
Usage notes
- If your Logtail version is V0.0, such as Logtail V0.16.x, you can run the installation
command in this topic to install Logtail on a Linux server. If you want to install
Logtail V1.0 or update the Logtail version to Logtail V1.0, you must add the version
number to the installation or update command. For example, if you want to install
Logtail V1.0, you must run the
./logtail.sh install cn-hangzhou -v v1
command. If you want to update the Logtail version to Logtail V1.0, you must run thesudo ./logtail.sh upgrade -v v1
command. - If you run the installation command on a server on which Logtail is installed, the installer uninstalls Logtail from the server, deletes the /usr/local/ilogtail directory, and then reinstalls Logtail. If the installation is successful, Logtail automatically runs and is added as a startup program.
- If the installation fails, submit a ticket.
- If you install Logtail on an Elastic Compute Service (ECS) instance that resides in the classic network and then change the network type from classic network to Virtual Private Cloud (VPC), you must update the Logtail configuration. For more information, see How do I update a Logtail configuration after I switch the network type of an ECS instance from the classic network to a VPC?.
Installation methods
The installation command varies based on the network type of the server on which you
want to install Logtail.
Before you run the installation command, you must replace the ${your_region_name} variable in the command with the value for the region where your project resides.
The following table describes the value of the ${your_region_name} variable for each region.
Region | Value of ${your_region_name} |
---|---|
China (Hangzhou) | cn-hangzhou |
China (Shanghai) | cn-shanghai |
China (Qingdao) | cn-qingdao |
China (Beijing) | cn-beijing |
China (Zhangjiakou) | cn-zhangjiakou |
China (Hohhot) | cn-huhehaote |
China (Ulanqab) | cn-wulanchabu |
China (Shenzhen) | cn-shenzhen |
China (Heyuan) | cn-heyuan |
China (Guangzhou) | cn-guangzhou |
China (Chengdu) | cn-chengdu |
China (Hong Kong) | cn-hongkong |
Russia (Moscow) | rus-west-1 |
US (Silicon Valley) | us-west-1 |
US (Virginia) | us-east-1 |
Singapore (Singapore) | ap-southeast-1 |
Australia (Sydney) | ap-southeast-2 |
Malaysia (Kuala Lumpur) | ap-southeast-3 |
Indonesia (Jakarta) | ap-southeast-5 |
Philippines (Manila) | ap-southeast-6 |
Thailand (Bangkok) | ap-southeast-7 |
India (Mumbai) | ap-south-1 |
Japan (Tokyo) | ap-northeast-1 |
South Korea (Seoul) | ap-northeast-2 |
Germany (Frankfurt) | eu-central-1 |
UAE (Dubai) | me-east-1 |
UK (London) | eu-west-1 |
Alibaba Cloud internal network (classic network or VPC)
- If you cannot identify the region where your ECS instance resides, you can use the
auto parameter in the Logtail installation script to install Logtail.
After you configure the auto parameter in the installation command, the Logtail installation script obtains and uses the metadata of the ECS instance to identify the region where your ECS instance resides. For more information about the metadata of ECS instances, see Overview of ECS instance metadata.
- Download the Logtail installation script over the Internet.
The download consumes approximately 10 KB of Internet traffic.
wget http://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh -O logtail.sh;chmod 755 logtail.sh
- Install Logtail by using the auto parameter.
The Logtail installation package for the region is automatically downloaded. The download does not consume Internet traffic.
./logtail.sh install auto
- Download the Logtail installation script over the Internet.
- If you can identify the region where your ECS instance resides, you can specify the
region in the installation command.
The Logtail installation script is downloaded over an internal network, and Logtail is manually installed. The download does not consume Internet traffic.
- Obtain the value of the ${your_region_name} variable for the region where your Log Service project resides.
For more information about the value of the ${your_region_name} variable for each region, see Table 1. For example, the value of the ${your_region_name} variable for the China (Hangzhou) region is cn-hangzhou.
- Replace the ${your_region_name} variable in the command with the value for the region where your project resides,
and then run the installation command.
wget http://logtail-release-${your_region_name}.oss-${your_region_name}-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ${your_region_name}
The following table describes the installation commands used to install Logtail in each region where a Log Service project resides.Region Installation command China (Hangzhou) wget http://logtail-release-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-hangzhou
China (Shanghai) wget http://logtail-release-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-shanghai
China (Qingdao) wget http://logtail-release-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-qingdao
China (Beijing) wget http://logtail-release-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-beijing
China (Zhangjiakou) wget http://logtail-release-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-zhangjiakou
China (Hohhot) wget http://logtail-release-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-huhehaote
China (Ulanqab) wget http://logtail-release-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-wulanchabu
China (Shenzhen) wget http://logtail-release-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-shenzhen
China (Heyuan) wget http://logtail-release-cn-heyuan.oss-cn-heyuan-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-heyuan
China (Guangzhou) wget http://logtail-release-cn-guangzhou.oss-cn-guangzhou-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-guangzhou
China (Chengdu) wget http://logtail-release-cn-chengdu.oss-cn-chengdu-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-chengdu
China (Hong Kong) wget http://logtail-release-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install cn-hongkong
US (Silicon Valley) wget http://logtail-release-us-west-1.oss-us-west-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install us-west-1
US (Virginia) wget http://logtail-release-us-east-1.oss-us-east-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install us-east-1
Singapore (Singapore) wget http://logtail-release-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-southeast-1
Australia (Sydney) wget http://logtail-release-ap-southeast-2.oss-ap-southeast-2-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-southeast-2
Malaysia (Kuala Lumpur) wget http://logtail-release-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-southeast-3
Indonesia (Jakarta) wget http://logtail-release-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-southeast-5
Philippines (Manila) wget http://logtail-release-ap-southeast-6.oss-ap-southeast-6-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-southeast-6
Thailand (Bangkok) wget http://logtail-release-ap-southeast-7.oss-ap-southeast-7-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-southeast-7
Japan (Tokyo) wget http://logtail-release-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-northeast-1
South Korea (Seoul) wget http://logtail-release-ap-northeast-2.oss-ap-northeast-2-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-northeast-2
India (Mumbai) wget http://logtail-release-ap-south-1.oss-ap-south-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install ap-south-1
Germany (Frankfurt) wget http://logtail-release-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install eu-central-1
UAE (Dubai) wget http://logtail-release-me-east-1.oss-me-east-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install me-east-1
UK (London) wget http://logtail-release-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install eu-west-1
Russia (Moscow) wget http://logtail-release-rus-west-1.oss-rus-west-1-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod 755 logtail.sh; ./logtail.sh install rus-west-1
- Obtain the value of the ${your_region_name} variable for the region where your Log Service project resides.
Internet
The following table describes the installation commands used to install Logtail in
each region where a Log Service project resides.
Region | Installation command |
---|---|
China (Hangzhou) |
|
China (Shanghai) |
|
China (Qingdao) |
|
China (Beijing) |
|
China (Zhangjiakou) |
|
China (Hohhot) |
|
China (Ulanqab) |
|
China (Shenzhen) |
|
China (Heyuan) |
|
China (Guangzhou) |
|
China (Chengdu) |
|
China (Hong Kong) |
|
US (Silicon Valley) |
|
US (Virginia) |
|
Singapore (Singapore) |
|
Australia (Sydney) |
|
Malaysia (Kuala Lumpur) |
|
Indonesia (Jakarta) |
|
Philippines (Manila) |
|
Thailand (Bangkok) |
|
Japan (Tokyo) |
|
South Korea (Seoul) |
|
Germany (Frankfurt) |
|
UAE (Dubai) |
|
India (Mumbai) |
|
UK (London) |
|
Russia (Moscow) |
|
Global acceleration
The following table describes the installation commands used to install Logtail in
each region where a Log Service project resides.
Region | Installation command |
---|---|
China (Beijing) |
|
China (Qingdao) |
|
China (Hangzhou) |
|
China (Shanghai) |
|
China (Shenzhen) |
|
China (Heyuan) |
|
China (Guangzhou) |
|
China (Zhangjiakou) |
|
China (Hohhot) |
|
China (Ulanqab) |
|
China (Chengdu) |
|
China (Hong Kong) |
|
US (Silicon Valley) |
|
US (Virginia) |
|
Singapore (Singapore) |
|
Australia (Sydney) |
|
Malaysia (Kuala Lumpur) |
|
Indonesia (Jakarta) |
|
Philippines (Manila) |
|
Thailand (Bangkok) |
|
Japan (Tokyo) |
|
South Korea (Seoul) |
|
Germany (Frankfurt) |
|
UAE (Dubai) |
|
India (Mumbai) |
|
UK (London) |
|
Russia (Moscow) |
|
Install Logtail offline
Note If you want to update Logtail offline, you can download the latest installation package
and run the
chmod +x logtail.sh; ./logtail.sh upgrade-local
command.
View the version of Logtail
Go to the installation directory of Logtail and open the /usr/local/ilogtail/app_info.json file. The value of the logtail_version field is the version of Logtail.
- Command
cat /usr/local/ilogtail/app_info.json
- Output
{ "UUID" : "0DF18E97-0F2D-486F-B77F-*********", "hostname" : "david*******", "instance_id" : "F4FAFADA-F1D7-11E7-846C-00163E30349E_*********_1515129548", "ip" : "**********", "logtail_version" : "0.16.30", "os" : "Linux; 2.6.32-220.23.2.ali1113.el5.x86_64; #1 SMP Thu Jul 4 20:09:15 CST 2013; x86_64", "update_time" : "2020-01-05 13:19:08" }
Update Logtail online
You can use the Logtail installation script logtail.sh to update Logtail. The installation
script automatically selects an update method based on the configurations of Logtail
that is installed.
Note Logtail is temporarily stopped during the update. However, no log data is lost. After
Logtail is updated, only the configuration files and the checkpoint files are retained.
Other files are overwritten.
Update Logtail offline
Start and stop Logtail
- Start Logtail
Run the following command as the root user:
/etc/init.d/ilogtaild start
- Stop Logtail
Run the following command as the root user:
/etc/init.d/ilogtaild stop
Uninstall Logtail
Run the following command to uninstall Logtail:
wget http://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh -O logtail.sh;chmod 755 logtail.sh;./logtail.sh uninstall