LogListener Installation Guide

Last updated: 2020-08-04 10:41:02

    LogListener is a log collector provided by Tencent Cloud Log Service (CLS). You can install and deploy it on a server to collect logs quickly.

    Installation Environment

    LogListener supports only Linux 64-bit operating systems but not Windows for the moment. It is compatible with mainstream Linux distributions. If it is incompatible with the Linux distribution you use, please submit a ticket for assistance.

    Operating System                Compatible Versions
    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
    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
    Debian (64-bit) Debian_8.2_64-bit, Debian_9.0_64-bit
    openSUSE (64-bit) openSUSE_42.3_64-bit

    Installation and Startup

    1. Downloading and installing LogListener

    Download the latest version of LogListener here.

    Download the LogListener installation package and decompress it to the installation path (/usr/local/ in this example). Then, go to the LogListener directory loglistener/tools and run the following installation command:

    wget https://loglistener-1254077820.cos.ap-shanghai.myqcloud.com/loglistener-linux-x64-2.3.1.tar.gz && tar -zxvf loglistener-linux-x64-2.3.1.tar.gz -C /usr/local && cd /usr/local/loglistener-2.3.1/tools && ./loglistener.sh install

    2. Initializing LogListener

    In the loglistener/tools path, run the following command to initialize LogListener as the root user (by default, the private network is used to access the service):

    ./loglistener.sh init -secretid AKIDPEtPyKabfW8Z3Uspdz83xxxxxxxxxxx -secretkey whHwQfjdLnzzCE1jIf09xxxxxxxxxxxx -region ap-xxxxxx

    Note:

    You need to replace -secretid, -secretkey, -region, and -network in the commands with the actual values. For more information, see parameter description below.

    Parameter description

    Parameter Description
    secretid Part of a TencentCloud API key, which is used to identify the API requester
    secretkey Part of a TencentCloud API key, which is used to encrypt the strings to create a signature so that Tencent Cloud server can validate the identity of the requester.
    region Region where CLS resides. Enter the region abbreviation, such as ap-beijing and ap-guangzhou
    network Type of the network through which LogListener accesses the service domain name. Valid values: intra (private network), internet (public network). Default value: intra.

    A private domain name is used by default:

    If you need to access the service domain name over the public network, run the following command to set the network parameter internet explicitly:

    ./loglistener.sh init -secretid AKIDPEtPyKabfW8Z3Uspdz83xxxxxxxxxxxx -secretkey whHwQfjdLnzzCE1jIf0xxxxxxxxxxxx -region ap-xxxxxx -network internet

    Note:

    • We recommend that you use a collaborator key, and the root account should grant the read/write permission of CLS to the collaborator.
    • region indicates the region of your CLS, instead of the region where your business server resides.
    • If your CVM instance and logset are in the same region, we recommend that you access the service domain name over the private network. Otherwise, use the public network.

    3. Starting LogListener

    After LogListener is successfully installed, run the following command to start it:

    /etc/init.d/loglistenerd start

    Using LogListener

    Note:

    The operation commands used in this document are only applicable to LogListener-2.2.4 and later versions. For operation commands applicable to earlier versions, see Operation Guide of Earlier LogListener Versions.

    Viewing LogListener version

    /etc/init.d/loglistenerd -v

    Starting LogListener

    /etc/init.d/loglistenerd start

    Restarting LogListener

    /etc/init.d/loglistenerd restart

    Stopping LogListener

    /etc/init.d/loglistenerd stop

    Initializing LogListener

    Run the initialization command in the loglistener/tools directory as an administrator:

    ./loglistener.sh init -secretid AKIDPEtPyKabfW8Z3Uspdz83xxxxxxxxxxxx -secretkey whHwQfjdLnzzCE1jIf09xxxxxxxxxxxx -region ap-xxxxxx

    Uninstalling LogListener

    Run the uninstallation command in the loglistener/tools directory as an administrator:

    ./loglistener.sh uninstall

    Checking LogListener process status

    /etc/init.d/loglistenerd status 

    LogListener normally runs two processes:

    Checking LogListener heartbeat and configuration

    /etc/init.d/loglistenerd check

    Manually Updating LogListener

    Reusing breakpoint files (logs will not be repeatedly collected)

    1. Run the stop command to stop the existing LogListener.
    2. Back up the breakpoint file directory (loglistener/data) on the old version; for example, back up the legacy breakpoint file to the /tmp/loglistener-backup directory.
      cp -r loglistener-2.2.3/data /tmp/loglistener-backup/
    3. Run the uninstallation command to uninstall the existing LogListener.
    4. Download the latest version of LogListener, and run relevant commands to install and initialize it.
    5. Copy the breakpoint file directory backed up in Step 2 to the new LogListener directory; for example:
      cp -r /tmp/loglistener-backup/data loglistener-2.2.8/
    6. Run the start command to start the latest version of LogListener.

    Not reusing the breakpoint file (logs may be repeatedly collected)

    1. Run the stop command to stop existing LogListener.
    2. Run the uninstallation command to uninstall the existing LogListener.
    3. Download the latest version of LogListener, and run relevant commands to install and initialize it.
    4. Run the start command to start the latest version of LogListener.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help