LogCollector is the log collection client provided by torch log service (TLS). It can be used for fast log data reporting. After installing LogCollector on the server, you can set collection rules and access TLS quickly via the console or configuration files.
This topic explains how to install, upgrade, or uninstall LogCollector on a Linux server.
Notice
Starting from LogCollector v2.2.0, the systemd service name is changed from filebeatd to logcollectord.
Preparations
- An available Linux server is required.
- LogCollector currently supports only Linux x86-64 (64-bit) operating systems and does not support ARM architecture or Windows operating systems.
- Systemd and wget are installed on the Linux server.
- Actions in this topic require using a user with root permission to log in to the Linux server.
- Based on the server type and region, determine the required network type for installing LogCollector.
- The IAM user has been created and the Access Key ID and Secret Access Key have been obtained. Besides, the user is granted at least the TLSLogCollectorAccess permission policy. For details about permissions, see IAM overview.
Install and start
1 Download LogCollector installation script
Based on region and network type of Linux server, run the corresponding download command to download LogCollector install script to a custom directory.
We recommend that you use private network downloading address. This helps you save public network traffic costs.
You need to replace Region ID in the download address with the actual region ID for your environment. For example, the region ID for North China 2 (Beijing) is cn-beijing. For supported regions, see Service address. - Private network download address
- Public network download address
2 Install and start LogCollector
Run the following command to install LogCollector. After installation, the LogCollector process starts automatically.
Notice
- If LogCollector is already installed, running the following command will prompt do you want to continue the installation? (y/n):. If you want to set continue the installation as a default action, add --continue_installation true into the command.
- If LogCollector is running, running the following command will prompt logcollectord is running, please stop logcollectord first. If you want to set continue the installation as a default action, add --directly_stop true into the command.
Among the parameters, region, endpoint, secret_id, and secret_key are required parameters. Details are as follows.
3 View the LogCollector running status
Run the following command to check LogCollector status. If the returned Active shows active (running)…, LogCollector is installed successfully and running normally.
Related operations
1 Modify LogCollector configuration file
During LogCollector operation, to update authentication parameters such as secret_id and secret_key, or identification parameters like label, execute the following command to edit the LogCollector configuration file.
See above for details on parameters such as region, endpoint, secret_id, and secret_key.
2 View software version
Run the following command to view the current LogCollector version installed on your device.
3 Process management
4 Uninstall LogCollector
Notice
If LogCollector is running, running the following command will prompt logcollectord is running, please stop logcollectord first. If you want to set continue the uninstallation as a default action, add --directly_stop true to the command.
Run the following command as administrator to uninstall LogCollector.