By Dumin, from Alibaba Cloud Storage Team
The machine group heartbeat is an important foundation for the normal operation of Logtail. However, the lack of machine group heartbeat is a common issue during the use of Logtail. There is a systematic process for troubleshooting this type of problem, and most problems can be solved in this troubleshooting process. Therefore, this article will focus on how to systematically troubleshoot the machine group heartbeat issue in the host scenario.
Log on to the machine where Logtail is located and perform a check based on the following methods:
Run the following command in the command line.
ps -ef | grep ilogtail
In normal cases, the returned result contains the following two pieces of information, indicating that Logtail is running. One indicates the Logtail daemon process and the other indicates the Logtail worker process.
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
...
Note: If three or more logtail commands are returned, multiple Logtail instances are running in the current environment, which may result in a duplicate collection. Check whether the command is as expected.
services.msc
to open the Services window.Check results
Logtail obtains a server IP address by using the following methods.
Logtail records the obtained IP addresses in the ip field of the app_info.json file. The default paths of the file in different systems are as follows.
{
"UUID" : "",
"hostname" : "iZ8vbdlzf******azuhZ",
"instance_id" : "E9633380-***********-00163E1AA597_172.16.2.200_166****11",
"ip" : "172.16.2.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"
}
The IP addresses involved in the machine group are all IP addresses obtained by Logtail. Please check the following:
Check results
The ilogtail_config.json file records the startup parameters of Logtail. To find the file, check whether the storage path of the file is specified in the environment variable.
echo $ALIYUN_LOGTAIL_CONFIG
If the returned result is not empty, the storage path of the file is the value of the environment variable, which is generally /etc/ilogtail/conf//ilogtail_config.json. If the returned result is empty, the default path of the file in different systems is as follows.
The Logtail configuration file is as follows.
{
"config_server_address" : "http://logtail.<config_region>.log.aliyuncs.com",
"data_server_list" :
[
{
"cluster" : "<project地域>",
"endpoint" : "<endpoint>"
}
],
...
}
Among them, <·> represents variables, and the specific parameters are selected in the following table.
To ensure that Logtail uploads data, you must ensure that Logtail can connect to the following addresses.
http://<project name>.<endpoint>
, where <endpoint>
is the address specified by the data_server_list.endpoint field in the ilogtail_config.json file.http://ali-<project region>-sls-admin.<endpoint>
, where <endpoint>
is the address specified by the data_server_list.endpoint field in the ilogtail_config.json file.(Where [-intranet] indicates whether the internal network is used or not. If yes, add -intranet.)
The network debugging method is as follows.
On the command line, call curl
commands to try to connect to the preceding addresses in sequence.
curl xxx
If all addresses return content similar to the following, the network is smooth.
{"Error":{"Code":"OLSInvalidMethod","Message":"The script name is invalid : /","RequestId":"5D****09"}}
On the command line, call telnet
commands to try to connect to the preceding addresses in sequence.
telnet xxx 80 # 443 if it is https.
If all addresses return content similar to the following, the network is smooth:
Trying 100*0*7*5...
Connected to xxx.
Escape character is '^]'.
Check results
Run the date
command on the command line to view the system time.
Wed Dec 28 06:59:26 UTC 2022
View the time information in the taskbar in the lower-right corner of the desktop.
Check results
enable_log_time_auto_adjust: true
to the configuration file ilogtail_config.json. For more information about the path of the configuration file, see Step 3.1. For more information about how to restart Logtail, see Appendix.If the server where Logtail resides is an ECS instance but does not belong to the same account as Log Service, or is a server of another cloud service provider or a self-built data center, you need to configure the primary account to which the Logtail project belongs as the user ID. This indicates that the account has permission to collect logs from the server through Logtail.
To check whether Logtail has correctly configured the user ID, first, check whether the user ID has been specified in the environment variable ALIYUN_LOGTAIL_USER_ID:
echo $ALIYUN_LOGTAIL_USER_ID
If the returned result is not empty, the system compares whether the value contains the same component as the project account ID. If the returned result is empty, the default directories of user ID files in different systems are as follows.
Check results
Linux: Run cd /etc/ilogtail/users/ && touch <uid>
on the command line, where is the ID of the Alibaba Cloud account to which the project belongs.
After the modification, you must restart Logtail. For more information about how to restart Logtail, see Appendix.
To check whether Logtail is correctly configured with a custom ID, first, check whether the custom ID has been specified in the environment variable ALIYUN_LOGTAIL_USER_DEFINED_ID.
echo $ALIYUN_LOGTAIL_USER_DEFINED_ID
If the returned result is not empty, compare whether the value contains the same component as the custom ID configured in the machine group. If the returned result is empty, the default path of the custom ID file in different systems is as follows.
Check results
After the modification, you must restart Logtail. For more information about how to restart Logtail, see Appendix.
Most machine group heartbeat issues can be resolved through the preceding troubleshooting process. If the issue persists, submit a ticket.
sudo /etc/init.d/ilogtaild restart
on the command line.services.msc
to open the Services window.Disclaimer: The views expressed herein are for reference only and don't necessarily represent the official views of Alibaba Cloud.
How is the Flame Graph Created? Exploring Flame Graphs in Pyroscope Source Code (1)
1,060 posts | 259 followers
FollowAlibaba Clouder - August 31, 2018
H Ohara - March 13, 2024
Alibaba Container Service - October 13, 2022
Alibaba Clouder - November 13, 2018
Alibaba Cloud Native Community - March 25, 2024
Alibaba Cloud Storage - June 19, 2019
1,060 posts | 259 followers
FollowPlan and optimize your storage budget with flexible storage services
Learn MoreA cost-effective, efficient and easy-to-manage hybrid cloud storage solution.
Learn MoreProvides scalable, distributed, and high-performance block storage and object storage services in a software-defined manner.
Learn MoreBuild a Data Lake with Alibaba Cloud Object Storage Service (OSS) with 99.9999999999% (12 9s) availability, 99.995% SLA, and high scalability
Learn MoreMore Posts by Alibaba Cloud Community