If the Logtail heartbeat status is abnormal when you use Logtail to collect logs, you can troubleshoot the problem by using the automatic diagnosis tool of Logtail or manual diagnosis.
Log Service provides the Logtail automatic diagnosis tool to troubleshoot the heartbeat problem. For more information, see Logtail quick diagnosis tool.
If the diagnosis result is normal, see the echo message of the diagnosis tool or the result of the manual diagnosis to check if any exception occurs.
The FAIL heartbeat status of Logtail is generally caused by the following reasons. Inspect the reasons one by one.
Run the following command to check the network connectivity. Make sure the network is normal.
telnet logtail.cn-<region>-intranet.log.aliyuncs.com 80
Virtual Private Cloud (VPC)
telnet logtail.cn-<region>-vpc.log.aliyuncs.com 80
telnet logtail.cn-<region>.log.aliyuncs.com 80
Run the following command to check the client status. If the Logtail client is not installed, install the Logtail in the same region and network type as your Log Service project. For more information, see Install Logtail on Linux or Install Logtail on Windows.
sudo /etc/init.d/ilogtaild status
Control Panel -> Management Tool -> Service
Check the running status of the following two Windows services: LogtailDaemon and LogtailWorker
Log Service has different regions. You must specify the correct service endpoint for the Logtail client during the installation. Check the configuration used by the installed Logtail client.
- Linux: /usr/local/ilogtail/ilogtail_config.json
- Windows x64: C:\Program Files (x86)\Alibaba\Logtail\ilogtail_config.json
- Windows x32: C:\Program Files\Alibaba\Logtail\ilogtail_config.json
Make sure that:
- The endpoint that the Logtail client connects is in the same region as your project. For more information about the endpoint list, see Service endpoint.
- You have selected the correct domain name according to the network environment of your machine. For example, an internal domain name selected in the VPC environment cannot be connected. Telnet to the domain name configured in
ilogtail_config.json, for example,
telnet logtail.cn-hangzhou-intranet.log.aliyuncs.com 80.
Generally, Logtail obtains the IP address on the machine in the following way:
- If the IP address is bound with the hostname in the file
/etc/hostson the current machine, confirm the bound IP address. Run the hostname command to view the hostname.
- If the IP address is not bound with the hostname, Logtail obtains the IP address of the first network adapter on the current machine.
To view the IP address on the server:
- Linux: /usr/local/ilogtail/app_info.json
- Windows x64: C:\Program Files (x86)\Alibaba\Logtail\app_info.json
- Windows x32: C:\Program Files\Alibaba\Logtail\app_info.json
Logtail cannot work if in the file
ipfield is empty. Configure the IP address for the host and then restart Logtail.
If the IP address entered in the Log Service machine group is different from that obtained by the Logtail client, modify as follows:
- Modify the IP address that is entered incorrectly in the Log Service machine group. Wait for one minute and check the heartbeat status.
- If the network configurations on the machine are modified (such as modifying the
/etc/hostsfile), restart Logtail to obtain the new IP address.
Run the following command to restart Logtail, if necessary:
- Linux: sudo /etc/init.d/ilogtaild stop; sudo /etc/init.d/ilogtaild start
- Windows: Control Panel > Management Tool > Service > Restart LogtailWorker
5. The machine whose logs are being collected is not an ECS instance, or is an ECS instance that does not belong to the account of the Log Service project
You must authorize the machine where Logtail is installed to collect logs in any of the following situations. For more information, see Configure user ID for non-Alibaba Cloud ECS.
- The machine is non-ECS machine.
- The account used to purchase the ECS instance and the one used to create the Log Service project is not the same one.
If the problem persists, open a ticket and provide your project, Logstore, machine group, app_info.json, ilogtail_config.json, and the output of the automatic diagnosis tool in the ticket.