Limits
Important
If your server has low specifications or your operating system runs an earlier version, compatibility issues may occur when you install Logtail version 2.0. In this case, other software cannot run as expected. We recommend that you download Logtail V1.8.7 and run the ./logtail.sh install ${region_id} -v 1.8.7
command to install Logtail.
Install Logtail
Install Logtail online
Network type | Scenario |
Alibaba Cloud internal network | The ECS instance that is used and your Simple Log Service project reside in the same region. |
Internet | |
Transfer acceleration | The server that is used is from a third-party cloud service provider outside China or in a data center outside China. Data transfer over the Internet may cause high network latency and unstable connections. In this case, we recommend that you use the transfer acceleration feature to transfer logs. |
Note
When you install Logtail online, Logtail is automatically installed based on the operating system of your server. You do not need to select a network type.
Alibaba Cloud internal network (classic network or VPC)
Internet
Transfer acceleration
Obtain the value of the Simple Log Service parameter for the region in which the Simple Log Service
project resides. Replace the ${region_id}
parameter with the obtained value and run the installation command.
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 install ${region_id}-internet
Obtain the value of the Simple Log Service parameter for the region in which the Simple Log Service
project resides. Replace the ${region_id}
parameter with the obtained value and run the installation command.
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
.
After installing Logtial using transfer acceleration, you need to enable the transfer acceleration feature for it to take effect. For more information, see Enable the transfer acceleration feature for a project.
wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod +x logtail.sh; ./logtail.sh install ${region_id}-acceleration
Install Logtail offline
Download the installation script and installation package on a server that can access the Internet.
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
.
Obtain the value of the Simple Log Service parameter for the region in which the Simple Log Service
project resides. Replace the ${region_id}
parameter with the obtained value and run the following command to download the installation script:
wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh
Obtain the value of the Simple Log Service parameter for the region in which the Simple Log Service
project resides. Replace the ${region_id}
parameter with the obtained value and run the following command to download the installation package:
Copy the installation script and installation package to the server on which you want to install Logtail.
Obtain the value of the Simple Log Service parameter for the region in which the Simple Log Service
project resides. Replace the ${region_id}
parameter with the obtained value and run the installation command.
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
.
Internet
chmod +x logtail.sh; ./logtail.sh install-local ${region_id}-internet
Internal network
chmod +x logtail.sh; ./logtail.sh install-local ${region_id}
Transfer acceleration
After installing Logtial using transfer acceleration, you need to enable the transfer acceleration feature for it to take effect. For more information, see Enable the transfer acceleration feature for a project.
chmod +x logtail.sh; ./logtail.sh install-local ${region_id}-acceleration
View the status and version of Logtail
View the status of Logtail
Run the following command to view the status of Logtail:
sudo /etc/init.d/ilogtaild status
If the following information is returned, Logtail is installed:
If Logtail is not in the Running state, uninstall Logtail and then reinstall Logtail.
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. Run the following command to view the version of Logtail:
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
Important
If you want to update Logtail, you can run the upgrade
command. If you run the install
command to update Logtail, an overwrite installation is performed. The system uninstalls the current version of Logtail, deletes related directories such as /usr/local/ilogtail
, and then installs a new version of Logtail. If the installation is successful, Logtail automatically runs and is added as a startup program.
Logtail is temporarily stopped during the update. No log data is lost. After Logtail is updated, only the configuration files and the checkpoint files are retained. Other files are overwritten.
When upgrading from Logtail version 1.x to version 2.x, ensure that the container discovery feature is disabled in your collection configuration. This means that the collection configuration page in the console should not display any terms related to container
, and you must ensure that both the EnableContainerDiscovery
and docker_file
parameters are set to false. Failing to do so may result in collection failures.
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
.
Obtain the value of the Simple Log Service parameter for the region in which the Simple Log Service
project resides. Replace the ${region_id}
parameter with the obtained value and run the following command to uninstall Logtail:
wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod +x logtail.sh; ./logtail.sh uninstall
Scenarios
Simple Log Service projects and servers belong to the same account and reside in the same region
We recommend that you use Simple Log Service with Operation Orchestration Service (OOS) to automatically install Logtail on ECS instances that reside in the same region as your Simple Log Service projects. For more information, see Install Logtail on ECS instances.
If automatic installation does not meet your requirements, you can manually install Logtail based on this topic.
Simple Log Service projects and servers belong to the same account but reside in different regions
If you install Logtail over the classic network or a VPC, you can modify the network parameters in the ilogtail_config.json file to configure Logtail to collect logs across regions. For more information, see Alibaba Cloud internal network (classic network or VPC).
Modify the network parameters in the /usr/local/ilogtail/ilogtail_config.json
file.
For example, your project resides in the China (Chengdu) region and your ECS instance resides in the China (Hangzhou) region. Modify the parameters based on the following code:
{
"config_server_address" : "http://logtail.cn-chengdu.log.aliyuncs.com",
"data_server_list" :
[
{
"cluster" : "cn-chengdu",
"endpoint" : "cn-chengdu.log.aliyuncs.com"
}
],
...
}
You must restart Logtail after the configuration file is modified.
sudo /etc/init.d/ilogtaild restart
Simple Log Service projects and servers belong to different accounts
In this scenario, the server on which you want to install Logtail belongs to an Alibaba Cloud account that is different from the account of your Simple Log Service projects or resides in a data center or a third-party cloud environment. The following figure shows the configuration process.
![image](https://help-static-aliyun-doc.aliyuncs.com/assets/img/en-US/2603349371/CAEQMRiBgICI.OOqnRkiIDU2ZTI3ZTc1NDQ2ZTRkMTNiMWMyODE2ZTRkYTQwNGM13963382_20230830144006.372.svg)
You must install Logtail over the Internet. Then, you must use the ID of Account A to configure a user identifier and configure a custom user identifier. For more information, see Configure a user identifier. Then, you must create a custom identifier-based machine group in the Simple Log Service project of Account A and configure Logtail to collect logs. For more information, see Manage machine groups, Collect text logs from servers, and Use Logtail to collect logs across Alibaba Cloud accounts.
FAQ
How do I check whether Logtail is installed?
You can view the status of Logtail to check whether Logtail is installed on your server. For more information, see View the status of Logtail.
After Logtail is installed, the heartbeat status of my machine group that is created for the Logtail configuration is FAIL. What do I do?
If heartbeat status is FAIL after a Logtail configuration is created, you can run the following command to view the version of Logtail. Then, update Logtail to check whether the heartbeat status becomes normal.
cat /usr/local/ilogtail/app_info.json
After Logtail is installed, Logtail starts to collect logs. However, a status code indicating that logs fail to be collected is returned. What do I do?
Logtail aggregates collected logs and sends the aggregated logs to Simple Log Service. If logs fail to be sent to Simple Log Service, Logtail determines whether to send the logs again or to stop sending the logs based on the error message. For more information, see Send logs.