If the heartbeat status of the Logtail machine group is abnormal when you use Logtail to collect logs, you can troubleshoot the problem through the Logtail auto-diagnosis tool or manually diagnose the problem.

After you install Logtail on your server for log collection, Logtail will send heartbeat packets to the server regularly. If the information indicating that the machine has no heartbeat is displayed on the machine group status page, the Logtail is disconnected from the server. In this case, you can either use the Logtail auto-diagnosis tool or manually diagnose the problem.
  • Automatic diagnosis: Log Service provides a Logtail auto-diagnosis tool that applies to Linux servers. For more information, see Logtail auto-diagnosis tool.
  • Manual diagnosis: If the Logtail auto-diagnosis tool fails to troubleshoot the problem or your server is running on Windows, troubleshoot the problem by performing the following steps.


1. Check whether Logtail has been installed.

Check whether the Logtail client has been installed by running the following command:
说明 If you have not installed the Logtail client, follow the installation instructions in Install Logtail in Linux and Install Logtail in Windows. Install Logtail in these operation systems based on the region your Log Service project belongs to and the network type.
  • In Linux:
    sudo /etc/init.d/ilogtaild status 
    If ilogtail is running is returned, Logtail has been installed. The following is an example:
    [root@****************~]# sudo /etc/init.d/ilogtaild status 
    ilogtail is running
  • In Windows:
    1. In Control Panel, choose System and Security > Administrative Tools, and then open the Services program.
    2. Check the running status of LogtailDaemon, LogtailWorker, and Windows services. If they are running normally, Logtail has been installed successfully.

If Logtail is running, go to the next step.

2. Check whether Logtail installation parameters are correct?

Before installing Logtail, you need to specify the correct server access portal. That is, you must use correct Logtail installation parameters according to the region to which the Log Service project belongs and decide how to install Logtail according to the network type. Incorrect installation script or parameters can be a reason why the Logtail machine has no heartbeat.

The Logtail configuration file ilogtail_config.json contains Logtail installation parameters and the installation method you use. The file is stored in:
  • The /usr/local/ilogtail/ilogtail_config.json directory in Linux
  • The C:\Program Files (x86)\Alibaba\Logtail\ilogtail_config.json directory in Windows x64
  • The C:\Program Files\Alibaba\Logtail\ilogtail_config.json directory in Windows x32
  1. Check installation parameters.

    Check whether the region of the network portal for Logtail client access in ilogtail_config.json is the same as the region to which the Log Service project belongs.

    The returned information in the following figure indicates that Logtail is installed on an ECS server in the cn-hangzhou region.

    图 1. Check installation parameters


  2. Check the installation method.

    Use Telnet to test the domain name contained in ilogtail_config.json to check whether Logtail is correctly installed according to the server's network type.

    For example, the domain name recorded in ilogtail_config.json is cn-hangzhou-intranet. You can run telnet logtail.cn-hangzhou-intranet.log.aliyuncs.com 80 to check the network connectivity. If the Logtail client is connected to the server, Logtail has been correctly installed.

    You can check network connectivity between Logtail and a Linux ECS server by running the following command:
    [root@*********** ~]# telnet logtail.cn-hangzhou-intranet.log.aliyuncs.com 80
    Trying 100*0*7*5...
    Connected to logtail.cn-hangzhou-intranet.log.aliyuncs.com.
    Escape character is '^]'. 

    If the preceding method fails, incorrect parameters were used during Logtail installation, as a result incorrect installation commands were executed. For information about correct installation parameters, see Install Logtail in Linux and Install Logtail in Windows.

If Logtail has been installed successfully, go to the next step.

3. Check whether the IP address of the machine group is correct.

The IP address configured for the machine group must be the server IP address obtained by Logtail. Otherwise, the machine has no heartbeat, or Logtail cannot collect logs.

Logtail obtains the machine IP address by using either of the following methods:

  • If the server name is not attached to the machine, the IP address of the first NIC on the server will be used.
  • If you have attached the server name to the machine in /etc/hosts, confirm the IP address to be attached. Then, you can run hostname to view the server name.

Troubleshooting procedure

  1. Check the IP address obtained by Logtail.

    The ip field in the app_info.json file specifies the IP address obtained by Logtail. The file is stored in:

    • The /usr/local/ilogtail/app_info.json directory in Linux
    • The C:\Program Files (x86)\Alibaba\Logtail\app_info.json directory in Windows x64
    • The C:\Program Files\Alibaba\Logtail\app_info.json directory in Windows x32
    说明
    • Logtail cannot work if the ip field is empty. In this case, you need to configure an IP address for the server and restart Logtail.
    • The app_info.json file only records information. Modifications to this file will not take effect on the IP address obtained by Logtail.
    图 2. View the IP address obtained by Logtail


  2. On the Machine Groups page, click Status to check the IP address configured for the machine group.
    图 3. View the machine group status

    If the IP address obtained by Logtail is not the machine group IP address, you need to modify the IP address.

    • If an incorrect IP address is configured for the machine group, modify the IP address and save it. Wait for a minute, and then check the heartbeat status.
    • If you have modified network configurations of the machine group, for example, /etc/hosts, you must restart Logtail to obtain the new IP address. Additionally, you need to modify the IP address configured for the machine group according to the ip field in the app_info.json file.
Logtail restart methods
  • In Linux, run the following command:
    sudo /etc/init.d/ilogtaild stop
    sudo /etc/init.d/ilogtaild start
  • In Windows, choose Control Panel > System and Security > Administrative Tools and open the Services program. Then, locate LogtailWorker and restart it.

If the IP address obtained by Logtail is the one configured for the machine group, go to the next step.

4. Check whether an AliUid has been configured for the ECS server under another Alibaba Cloud account.

For ECS servers under other Alibaba Cloud accounts, servers provided by other cloud product vendors, and on-premises IDCs, you must configure AliUids for them to authorize the servers with Logtail installed.

Check whether a file named after your Alibaba Cloud account ID exists in the /etc/ilogtail/users directory.

If such a file does not exist, follow the instructions provided in Configure AliUids for ECS servers under other Alibaba Cloud accounts and on-premises IDCs.

说明
  • AliUids must be Alibaba Cloud account IDs.
  • You can view your Alibaba Cloud account ID on the User Info page in the Alibaba Cloud console.
    图 4. View your Alibaba Cloud account ID


If the problem persists, open a ticket to submit the problem details to Log Service engineers. The ticket must contain information about your project, Logstore, machine group, app_info.json, ilogtail_config.json, and output of the auto-diagnosis tool.