This topic explains how to resolve issues when a Logtail machine group shows no heartbeat in a host environment.
Machine group installation examples
-
Machine group configuration: ECS and Simple Log Service project are under the same account and region.
-
Collect logs across regions using Logtail: ECS and Simple Log Service project are under the same account but in different regions.
-
Collect logs across Alibaba Cloud accounts using Logtail: Projects and ECS servers are under different accounts, or involve other clouds or self-managed servers.
Troubleshooting preview
-
Step 1: Verify that Logtail is operational: Ensure Logtail is functioning correctly on the server.
-
Step 2: Confirm the IP address in the machine group matches the IP address retrieved by Logtail: Ensure the IP address listed in the machine group matches the IP address in Logtail's app_info.json file. Discrepancies will cause heartbeat failures.
-
Step 3: Verify the Validity of Logtail Startup Parameters: Ensure that the project region specified in the
ilogtail_config.json
file is correct. -
Step 4: Confirm network connectivity: Check the network connection between the server and the project.
-
Step 5: Verify the server's system time is accurate: Adjust the system time if it deviates from the local time.
-
Step 6: Check for a user identifier: If the project and ECS server are under different accounts or involve other clouds or self-managed servers, verify the presence of a user identifier.
-
Step 7: Ensure a custom identifier is set up: If using a custom identifier-based machine group, confirm a custom identifier is in place.
Step 1: Check whether Logtail is running as expected
Linux
-
Log on to the Linux server where Logtail is installed.
-
Execute the command below.
ps -ef | grep ilogtail
-
If the output shows information similar to the sample below, Logtail is running as expected. The sample indicates the Logtail daemon and worker processes.
UID PID PPID C STIME TTY TIME CMD ... root 12 1 0 Nov10 ? 00:00:00 /usr/local/ilogtail/ilogtail root 14 12 0 Nov10 ? 03:07:43 /usr/local/ilogtail/ilogtail ...
ImportantIf more than two Logtail processes are found, multiple instances are running on the server, which may lead to duplicate data collection. Ensure this aligns with your requirements.
-
If no Logtail-related processes are detected:
-
If Logtail is installed but not running, refer to Starting and stopping Logtail (Linux) for guidance.
-
If Logtail is not installed, proceed with the installation. For details, see Installing Logtail (Linux).
ImportantDuring installation, ensure you select an operating system compatible with Logtail installation. Choose installation parameters according to the Simple Log Service project's region, and select the installation method that matches your network type. For more information on network types, see selecting a network.
-
-
Windows
-
Log on to the Windows server where Logtail is installed.
-
Open the Run dialog and type
services.msc
. -
Check the status of the LogtailDaemon service (Logtail V1.0.0.0 or later) or LogtailWorker service (Logtail V0.x.x.x).
If these services are not running:
-
If Logtail is installed but not active, see Manually starting and stopping Logtail (Windows) for instructions.
-
If Logtail is not installed, proceed with the installation. For details, see Installing Logtail (Windows).
ImportantDuring installation, ensure you select an operating system compatible with Logtail installation. Choose installation parameters according to the region associated with the Simple Log Service project, and select the appropriate installation method for your network type. For more details on network types, see Select Network.
-
Step 2: Check whether the IP address that is specified in the machine group is the same as the IP address that is obtained by Logtail
Logtail retrieves the IP address of a Linux server as follows:
-
If the hostname is not associated with an IP address, Logtail uses the IP address of the first network interface card (NIC).
-
To specify a custom IP address, set the
working_ip
parameter in theilogtail_config.json
file as outlined in Step 3. Once set, the ip field in theapp_info.json
file will automatically reflect theworking_ip
value. For detailed information on theworking_ip
parameter, refer to Set startup parameters. -
When the hostname is associated with an IP address in the
/etc/hosts
file, Logtail retrieves the corresponding IP address.
-
Retrieve the value of the
ip
field in the app_info.json file.The default file path varies by operating system, as shown in the table below:
Operating system
Logtail
Path of the app_info.json file
Linux
Logtail (64-bit)
/usr/local/ilogtail/app_info.json
Windows (64-bit operating system)
Logtail (64-bit)
C:\Program Files\Alibaba\Logtail\app_info.json
Logtail (32-bit)
C:\Program Files (x86)\Alibaba\Logtail\app_info.json
Windows (32-bit operating system)
Logtail (32-bit)
C:\Program Files\Alibaba\Logtail\app_info.json
Logtail records the retrieved IP address in the
ip
field of the app_info.json file.{ "UUID" : "", "hostname" : "iZ8vbdlzf******azuhZ", "instance_id" : "E9633380-***********-00163E1AA597_172.16.2.200_166****11", "ip" : "172.**.**.200", "logtail_version" : "1.3.1", "os" : "Linux; 4.19.91-26.1.al7.x86_64; #1 SMP Tue Jul 26 17:52:28 CST 2022; x86_64", "update_time" : "2022-12-27 05:38:33" }
-
Verify that the IP address retrieved by Logtail is listed in the machine group.
Simple Log Service offers two types of machine groups: those based on IP addresses and those using custom identifiers. For more information, see what is a machine group.
-
IP address-based machine group: Confirm that the IP Address field includes the IP address retrieved in the previous step.
If the IP Address field lists different IP addresses, such as a public IP, update it to the IP address retrieved by Logtail and check for normal heartbeat activity. If the heartbeat is normal, troubleshooting can cease.
-
Custom identifier-based machine group: Ensure the Machine Group Status includes the IP address retrieved in the previous step. If the Heartbeat displays OK, the troubleshooting process can be concluded.
-
Step 3: Check whether the Logtail startup parameters are valid
The ilogtail_config.json file contains Logtail's startup parameters.
-
Log on to the server where Logtail is installed.
-
Locate the ilogtail_config.json file.
The default file path varies by operating system, as shown in the table below:
Operating system
Logtail
Path of the ilogtail_config.json file
Linux
Logtail (64-bit)
/usr/local/ilogtail/ilogtail_config.json
Windows (64-bit operating system)
Logtail (64-bit)
\ilogtail_config.json
Logtail (32-bit)
C:\Program Files (x86)\Alibaba\Logtail\ilogtail_config.json
Windows (32-bit operating system)
Logtail (32-bit)
C:\Program Files\Alibaba\Logtail\ilogtail_config.json
-
Open the ilogtail_config.json file and check the validity of the parameters within.
{ "config_server_address" : "http://logtail.<config_region>.log.aliyuncs.com", "data_server_list" : [ { "cluster" : "<project region>", "endpoint" : "<endpoint>" } ], ... }
-
If the startup parameter configurations in the ilogtail_config.json file align with the descriptions in the table below, the parameters are valid.
-
If the startup parameters are invalid, modify the ilogtail_config.json file according to the descriptions in the table below and restart Logtail. For more information, see Appendix: Restart Logtail.
For details on the project region, see Service regions.
Scenario
Network type
<config_region>
<endpoint>
The server is an Elastic Compute Service (ECS) instance that resides in the same region as the project
Alibaba Cloud internal network
<project region>-intranet
<project region>-intranet.log.aliyuncs.com
Other scenarios
Public network
<project region>
<project region>.log.aliyuncs.com
Transfer acceleration
log-global.aliyuncs.com
-
-
Step 4: Check whether the network connection is established
Logtail can only upload data to Simple Log Service if the server can connect to the following addresses.
When using the internal network, append -intranet
to the end of <endpoint>
.
-
The
config_server_address
field in theilogtail_config.json
file specifies the address, which also has an HTTPS version. -
http://<project name>.<endpoint>
.-
The project name and region can be viewed as follows.
-
<endpoint>
refers to the address defined in thedata_server_list.endpoint
field within theilogtail_config.json
file.
-
-
Access the service at
http://ali-<project region>-sls-admin.<endpoint>
. The<endpoint>
corresponds to the address defined by thedata_server_list.endpoint
parameter in theilogtail_config.json
file.
To verify network connectivity, follow these steps:
Linux
-
Log on to the Linux server where Logtail is installed.
-
Use the
curl
command to connect to the addresses listed above in sequence.curl http://<project name>.cn-hangzhou-intranet.log.aliyuncs.com
If each command returns information similar to the code below, network connectivity is established.
{"Error":{"Code":"OLSInvalidMethod","Message":"The script name is invalid : /","RequestId":"5D****09"}}
If connectivity is not established, check if ports 80 and 443 are open, if the destination address is blocked, and if other network configurations such as DNS settings and security groups are correct.
Windows
-
Log on to the Windows server where Logtail is installed.
-
Use the
telnet
command to connect to the addresses listed above in sequence.telnet <project name>.cn-hangzhou-intranet.log.aliyuncs.com 80 # If the protocol is HTTPS, the port number is 443.
If each command returns information similar to the code below, network connectivity is established.
Trying 100*0*7*5... Connected to xxx. Escape character is '^]'.
If connectivity is not established, check if ports 80 and 443 are open, if the destination address is blocked, and if other network configurations such as DNS settings and security groups are correct.
Step 5: Check whether the system time of the server on which Logtail is installed is correct
Linux
-
Log on to the Linux server where Logtail is installed.
-
Run the
date
command to check the system time.Wed Dec 28 06:59:26 UTC 2022
If the system time is incorrect, take the following actions:
-
Adjust the system time to match the local time.
-
If you cannot adjust the system time, add the following parameter to the ilogtail_config.json file:
"enable_log_time_auto_adjust": true
. After modifying the file, restart Logtail. For more information, see Appendix: Restart Logtail. For the ilogtail_config.json file path, refer to Step 3: Validate the Logtail startup parameters.
-
Windows
-
Log on to the Windows server where Logtail is installed.
-
Check the time displayed on the taskbar in the desktop's lower-right corner.
-
Adjust the system time to match the local time.
-
If you cannot adjust the system time, add "enable_log_time_auto_adjust": true to the ilogtail_config.json file. After modifying the file, restart Logtail. For more information, see Appendix: Restart Logtail. For the ilogtail_config.json file path, refer to Step 3: Validate the Logtail startup parameters.
-
Step 6: Check whether a user identifier exists
-
If you use other clouds or self-managed servers, or if the project and ECS server are under different accounts, verify the user identifier.
-
A user identifier must be an Alibaba Cloud account ID. For more information, see Configuring a user identifier.
Check for a user identifier based on the user identifier file in the specified directory. If no output is returned, ensure a user identifier file exists at the specified path.
The user identifier file path varies by operating system:
-
Linux: /etc/ilogtail/users/
-
Windows: C:\LogtailData\users\
-
If the user identifier file is missing or invalid in the specified directory, follow these steps to resolve the issue:
-
Linux: Execute
cd /etc/ilogtail/users/ && touch <uid>
to create a user identifier file, where<uid>
is the Alibaba Cloud account ID associated with the project. -
Windows: Navigate to
C:\LogtailData\users\
and create an empty file named<uid>
, where<uid>
is the Alibaba Cloud account ID associated with the project.
-
-
If a file named after the Alibaba Cloud account ID associated with the project exists in the specified directory, the user identifier is configured correctly.
Step 7: Check whether a custom identifier is configured if you use a custom identifier-based machine group
Verify the presence of a custom identifier on the server by checking the user_defined_id file in the specified directory.
-
If no output is returned, confirm the existence of the
user_defined_id
file or that a custom identifier is configured within it.NoteThe path of the user_defined_id file varies based on the operating system:
-
Linux: /etc/ilogtail/user_defined_id
-
Windows: C:\LogtailData\user_defined_id
-
If the user_defined_id file is missing, create one and enter the custom identifier for the machine group. For guidance, see Configuring a custom identifier.
-
If the user_defined_id file is present but lacks a custom identifier or contains an invalid one, add the correct custom identifier to the file. For instructions, see Configuring a custom identifier.
-
If the user_defined_id file includes the custom identifier you specified for the machine group, the custom identifier is correctly configured.
-
After completing the above steps, restart Logtail. For instructions, see Appendix: Restart Logtail.
What to do next
If the issue persists after you have followed the steps above, submit a ticket.
Appendix: Restart Logtail
Linux
-
Log on to the Linux server where Logtail is installed.
-
Execute the following command:
sudo /etc/init.d/ilogtaild restart
Windows
-
Log on to the Windows server where Logtail is installed.
-
Open the Run dialog and type
services.msc
. -
Restart the LogtailDaemon service (Logtail V1.0.0.0 or later) or the LogtailWorker service (Logtail V0.x.x.x).