tencent cloud

Cloud Log Service

LogListener Installation Guide (Linux Version)

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-06-05 18:42:31
LogListener is a dedicated log collector provided by the Cloud Log Service (CLS) of Tencent Cloud. It can be installed and deployed on the server to quickly collect logs into the CLS.

Installation Environment

This document describes the installation of LogListener on Linux operating systems. For Windows operating systems, see the LogListener Installation Guide (Windows).
Note:
If an exception occurs during the installation of other editions, submit a ticket to contact us.
Processor Architecture
Operating System Category
Supported Installation Environment
x64/ARM
TencentOS Server
TencentOS Server 3.1,TencentOS Server 2.4
CentOS (64-bit)
CentOS_6.8_64-bit, CentOS_6.9_64-bit, CentOS_7.2_64-bit, CentOS_7.3_64-bit, CentOS_7.4_64-bit, CentOS_7.5_64-bit, CentOS_7.6_64-bit, CentOS_8.0_64-bit
Ubuntu (64-bit)
Ubuntu Server_14.04.1_LTS_64-bit, Ubuntu Server_16.04.1_LTS_64-bit, Ubuntu Server_18.04.1_LTS_64-bit, Ubuntu Server_20.04.1_LTS_64-bit, Ubuntu Server_22.04.1_LTS_64-bit
Debian (64-bit)
Debian_8.2_64-bit, Debian_9.0_64-bit, Debian_12.0_64-bit
openSUSE (64-bit)
openSUSE_42.3_64-bit
For detailed information on LogListener version feature changes, see LogListener Version Changes.

Preparations

You need to download the loglistener_operator script first.
Private Network Download URL:
wget https://mirrors.tencentyun.com/install/cls/script/loglistener/loglistener_operator && chmod u+x loglistener_operator
Public Network Download URL:
wget https://mirrors.tencent.com/install/cls/script/loglistener/loglistener_operator && chmod u+x loglistener_operator

Operation Steps

Step 1: Install LogListener

Execute the script using the root user with the following command:
Install the latest version
Install the specified version
Install using a local package
Install from a Specified URL
# Private Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region}

# Public Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} -n internet
# Private Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} --version ${version}

# Public Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} --version ${version} -n internet
Note:
The script only supports installing packages of version 3.4.0 and above.
# Private Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} --package_path ${package_path}

# Public Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} --package_path ${package_path} -n internet
# Private Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} --url https://xxx.tar.gz

# Public Network Access
./loglistener_operator install -s ${secret_id} -k ${secret_key} -r ${region} --url https://xxx.tar.gz -n internet
Note:
In the installation command, -secret_id, -secret_key, and -region are required parameters. For more parameters, see the parameter specifications below.
If the root account has granted read/write permissions for the CLS to the collaborator, it is recommended to use the collaborator's key.
-region specifies the region of the CLS service you use, not the region where your business servers are located. When the CLS region differs from your business server region, additionally configure the -network parameter as internet, which represents public network access.
When the Cloud Virtual Machine (CVM) and the logset are in the same region, it is recommended to access the service domain name via the private network. Conversely, if they are located in different regions, it is recommended to access the service domain name via the public network.
For details about log collection permissions, see LogListener log collection permission.
After the installation is completed, the returned result is as follows:


Parameter Description

Parameter Name
Required
Description
-s
Yes
Part of the Cloud API Key, which is used to identify the API caller. Ensure that the account associated with the Cloud API key has the appropriate LogListener log collection permission.
-k
Yes
TencentCloud API Key consists of two parts. SecretKey is the key used to encrypt signature strings and verify signature strings on the server side. Ensure that the account associated with the TencentCloud API Key has the corresponding LogListener log collection permission.
-n
No
Specifies how LogListener accesses the service domain name. Valid values: internal (private network access, default), internet (public network access).
Private network access: Applicable to Tencent Cloud servers located in the same region as the machine group.
Public network access: Applicable to non-Tencent Cloud servers or to servers located in regions that do not match those of the machine group.
-r
Yes
region indicates the region where the CLS is deployed. Enter the appropriate domain name abbreviation, such as ap-beijing or ap-guangzhou.
Note:
When the region of the CLS service you use differs from that of your business servers, configure the network parameter as internet, which represents public network access.
-d
No
Indicates the domain name of the region where the CLS service is located, such as ap-beijing.cls.tencentyun.com, ap-guangzhou.cls.tencentyun.com, and so on.
Note:
When the region of the CLS service you use differs from that of your business servers, configure the public network domain name, for example, ap-beijing.cls.tencentcs.com.
-i
No
The IP address of the machine. The machine group can be associated with the machine using the configured IP address. For details, see Machine Group. If left blank, LogListener will automatically retrieve the IP address of the local machine.
-l
No
Machine id. After the machine id is configured, the machine will be associated with machine groups that have the same machine id. For details, see Machine Group. Multiple ids should be separated by commas.
Note:
If a machine label is configured, the machine can only be associated with the machine group using the machine label instead of the IP address; if not configured, the machine group can only be associated with the machine using the IP address.
-p
No
Port, default 80. If HTTPS encrypted transmission is required, specify 443.
-u
No
By default, machine id is not uploaded to CLS.
--base_dir
No
LogListener installation path. By default, it is installed in the /opt directory.
--package_path
No
Specify the path of the local package when a local package is used for installation.
--url
No
Specify the URL of the mirrors repository when installing via URL.
--version
No
Specify the version number to install; the latest version is installed by default.
--dynamic_ip
No
Controls whether to enable the dynamic IP address auto-detection capability. Default: false. If set to true, updates can be applied in real time when the IP address changes (supported only in machine id scenarios; not available for IP address association scenarios).
Note:
This parameter is supported only in LogListener version 3.5.7 and above.
--switch_endpoint
No
Enable backup domain. Default: false. If set to true, the backup domain will be used when the primary domain network fails.
When the input parameter is set to true, the configuration file adds a backup_endpoints field (backup domain), and the system will automatically populate the backup domain.
If the user initializes with private network access, backup_endpoints will be automatically populated with the public network.
If the user initializes with public network access, backup_endpoints will be automatically populated with the private network.
You can also manually modify the backup domain in the configuration file (multiple entries are supported). If the primary domain is inaccessible, LogListener will attempt each backup domain in sequence until successful.
Note:
This parameter is supported only in LogListener version 3.5.7 and above.
Note:
For more details, use ./loglistener_operator install --help.

If you need to adjust Loglistener's configuration and keys after initialization, see Loglistener Configuration Guide.

Step 2: Start LogListener

systemctl start loglistener
Run systemctl check loglistener to check whether it has started successfully:


Step 3: Add to a machine group

After LogListener is installed and started, you need to create or select an existing machine group in the CLS console and add the server to the machine group. You can add the server to the machine group in either of the following ways:

Step 4: Collect logs

After the server is added to the machine group, you can then configure the collection of text logs on the server.

Common LogListener Operations

Version ≥ 3.4.0
Version < 3.4.0
Check the LogListener version: To check the version, run the following command in the LogListener installation directory (the default installation directory is /opt/loglistener).
./loglistener -v
Check the LogListener help documentation: To view the help information, run the following command in the LogListener installation directory (the default installation directory is /opt/loglistener).
./loglistener -h
Stop LogListener:
systemctl stop loglistener
Restart LogListener:
systemctl restart loglistener
Run systemctl check loglistener to check whether it has restarted successfully.
Check the LogListener process status:
systemctl status loglistener

Check LogListener heartbeat and configuration:
systemctl check loglistener
Uninstall LogListener:
1.1 Use the stop command systemctl stop loglistener to stop running the old version of LogListener.
systemctl stop loglistener
1.2 You need to execute the uninstall command with administrator privileges in the LogListener installation directory (default installation directory /opt/loglistener), specifically in the /opt/loglistener/tools directory.
./loglistener_operator uninstall
Check the LogListener version:
/etc/init.d/loglistenerd -v
Check the LogListener help documentation:
/etc/init.d/loglistenerd -h
Stop LogListener:
Execute via systemd. This applies to LogListener 2.8.3 or later, and requires the operating system to have systemd.
systemctl stop loglistenerd
Execution is not performed via systemd. This applies to LogListener 2.8.3 or earlier, or LogListener 2.8.3 or later, but without systemd in the operating system.
/etc/init.d/loglistenerd stop
Restart LogListener:
Execute via systemd. This applies to LogListener 2.8.3 or later, and requires the operating system to have systemd.
systemctl restart loglistenerd
Run /etc/init.d/loglistenerd check to check whether the restart is successful.



Execution is not performed via systemd. This applies to LogListener 2.8.3 or earlier, or LogListener 2.8.3 or later, but without systemd in the operating system.
/etc/init.d/loglistenerd restart
Return sample of successful reboot

Check the LogListener process status:
/etc/init.d/loglistenerd status
LogListener normally runs two processes:



Check LogListener heartbeat and configuration:
/etc/init.d/loglistenerd check



Modify LogListener Configuration: See LogListener Configuration Guide.
Uninstall LogListener:
1.1 Use the stop command to stop running the old version of LogListener.
1.2 Using the installation path /usr/local/ as an example, execute the uninstall command with administrator privileges in the /usr/local/loglistener/tools directory:
./loglistener.sh uninstall
Manually Update LogListener:
Reuse Breakpoint Files (No Duplicate Log Collection):
1.1 Use the stop command to stop running the old version of LogListener.
1.2 Using the installation directory /usr/local/loglistener as an example, navigate to the installation directory and back up the checkpoint file directory ./data from the old version. For instance, back up the old version's checkpoint files to the /tmp/loglistener-backup directory.
cp -r ./data /tmp/loglistener-backup/
1.3 Use the uninstall command to uninstall the old version of LogListener.
1.4 Download and install the latest version of LogListener, and initialize the new LogListener.
1.5 Using the installation directory /usr/local/loglistener as an example, copy the backed-up checkpoint file directory (Step 2) to the new version LogListener directory.
cp -r /tmp/loglistener-backup/data ./
1.6 Use the start command to start the new version of LogListener.
Do Not Reuse Breakpoint Files (Duplicate Log Collection May Occur):
1.1 Use the stop command to stop running the old version of LogListener.
1.2 Use the uninstall command to uninstall the old version of LogListener.
1.3 Download and install the latest version of LogListener, and initialize the new LogListener.
1.4 Use the start command to start the new version of LogListener.

Upgrade Guide

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백