All Products
Search
Document Center

Simple Log Service:What do I do if the heartbeat status of a machine group is FAIL because no IP addresses are recorded in the app_info.json file of Logtail?

Last Updated:May 11, 2024

This topic describes how to troubleshoot the issue that the heartbeat status of a machine group is FAIL because no IP addresses are recorded in the app_info.json file of Logtail.

Problem description

The heartbeat detection configuration of a machine group in the Simple Log Service console failed. The troubleshooting results show that no IP addresses are recorded in the app_info.json file.

Logic of obtaining an IP address

Logtail obtains the IP address from a server to the app_info.json file based on the following logic:

  1. Access the /etc/hosts file on the server and obtain the IP address from the parsing record of the hostname.

  2. If the first network interface controller (NIC) card of the server is not found and the /etc/hosts file does not contain the parsing record of the hostname, the ip field in the app_info.json file is empty.

  3. If the /etc/hosts file does not contain the parsing record of the hostname, Logtail obtains the IP address of the first NIC card of the server.

Solution

  1. Connect to a Linux instance in remote mode. For more information, see Connect to a Linux instance by using an SSH key pair.

  2. Run the following command to obtain the hostname of the instance:

    hostname
  3. Run the following command to edit the /etc/hosts file:

    sudo vi /etc/hosts
  4. Add the parsing record of the hostname.

    ${Host IP address}   ${Hostname} 
  5. Press the Esc key on your keyboard. Then, enter :wq and press the Enter key.

  6. Run the following command to check whether the parsing record takes effect:

    ping ${Hostname}