All Products
Search
Document Center

Simple Log Service:Install Logtail on a Windows server

Last Updated:Sep 18, 2024

This topic describes how to install Logtail on a Windows server.

Prerequisites

The following Windows operating systems are supported:

Note
  • If your server uses Windows Server 2008 or Windows 7, make sure that the operating systems run on x86 or x86_64.

  • If your server uses a different Windows operating system, make sure that the operating system runs on x86_64.

  • Microsoft Windows Server 2008

  • Microsoft Windows Server 2012

  • Microsoft Windows Server 2016

  • Microsoft Windows Server 2019

  • Microsoft Windows Server 2022

  • Microsoft Windows 7

  • Microsoft Windows 10

  • Microsoft Windows Server Version 1909

  • Microsoft Windows Server Version 2004

Install Logtail

  1. Log on to your server.

  2. Download an installation package based on your business requirements.

  3. Decompress the logtail_installer.zip package to the current directory.

  4. Select an installation command based on the network type and the region where your Simple Log Service project resides, and run the installation command.

    Network type

    Scenario

    Alibaba Cloud internal network

    The ECS instance that is used and your Simple Log Service project reside in the same region.

    Internet

    • The ECS instance that is used and your Simple Log Service project reside in different regions.

    • The server that is used is from a third-party cloud service provider or in a data center.

    Transfer acceleration

    The server that is used is from a third-party cloud service provider outside China or in a data center outside China. Data transfer over the Internet may cause high network latency and unstable connections. In this case, we recommend that you use the transfer acceleration feature to transfer logs.

    Alibaba Cloud internal network (the classic network or a VPC)

    1. Run Windows PowerShell or Command Prompt as an administrator. Go to the logtail_installer directory, which contains the files extracted from the installation package.

    2. Obtain the value of the ${your_region_name} variable for the region where your Simple Log Service project resides.

      For more information about the value of the ${your_region_name} variable for each region, see Appendix: Region names for Logtail installation. For example, the value of the ${your_region_name} variable for the China (Hangzhou) region is cn-hangzhou.

    3. Replace the ${your_region_name} variable in the installation command with the value for the region where your project resides, and then run the installation command.

      .\logtail_installer.exe install ${your_region_name}

    Internet

    1. Run Windows PowerShell or Command Prompt as an administrator. Go to the logtail_installer directory, which contains the files extracted from the installation package.

    2. Obtain the value of the ${your_region_name} variable for the region where your Simple Log Service project resides.

      For more information about the value of the ${your_region_name} variable for each region, see Appendix: Region names for Logtail installation. For example, the value of the ${your_region_name} variable for the China (Hangzhou) region is cn-hangzhou.

    3. Replace the ${your_region_name} variable in the installation command with the value for the region where your project resides, and then run the installation command.

      .\logtail_installer.exe install ${your_region_name}-internet

    Global acceleration

    1. Run Windows PowerShell or Command Prompt as an administrator. Go to the logtail_installer directory, which contains the files extracted from the installation package.

    2. Obtain the value of the ${your_region_name} variable for the region where your Simple Log Service project resides.

      For more information about the value of the ${your_region_name} variable for each region, see Appendix: Region names for Logtail installation. For example, the value of the ${your_region_name} variable for the China (Hangzhou) region is cn-hangzhou.

    3. Replace the ${your_region_name} variable in the installation command with the value for the region where your project resides, and then run the installation command.

      .\logtail_installer.exe install ${your_region_name}-acceleration
      Important

      If your project resides in a region of Alibaba Finance Cloud, you cannot install Logtail by running an installation command that is suitable for global acceleration.

  5. View the installation path.

    Important

    After you run the installation command, Logtail is automatically installed. The installation path varies based on the operating system. You cannot change the installation path.

    • Logtail for 32-bit Windows

      • In 32-bit Windows, Logtail is installed in the C:\Program Files\Alibaba\Logtail directory.

      • In 64-bit Windows, Logtail is installed in the C:\Program Files (x86)\Alibaba\Logtail directory.

        Note

        You can run 32-bit and 64-bit applications in 64-bit Windows. To ensure compatibility, the operating system stores 32-bit applications in a separate x86 directory.

    • Logtail for 64-bit Windows

      You can install Logtail for 64-bit Windows only in 64-bit Windows. The installation path is C:\Program Files\Alibaba\Logtail.

View the status and version of Logtail

After Logtail is installed on your server, you can view the status and version of Logtail.

View the status of Logtail

You can view the status of Logtail to check whether Logtail is installed on your server.

  1. Open the Run command window and enter services.msc to open the Services window.

  2. View the status of the LogtailDaemon or LogtailWorker service. For Logtail V1.0.0.0 or later, view the status of the LogtailDaemon service. For Logtail V0.x.x.x, view the status of the LogtailWorker service.

    If the services are in the Running state, Logtail is installed.

View the version of Logtail

Go to the installation path and open the app_info.json file. The value of the logtail_version field in the file is the Logtail version.

In the following example, the Logtail version is 1.0.0.0.

{
    "logtail_version" : "1.0.0.0"
}

Update Logtail

To update Logtail, you must download and decompress the most recent installation package. Then, you can install Logtail as prompted to complete the update. The procedure of updating Logtail is similar to the procedure of installing Logtail. For more information, see Install Logtail.

Important
  • During an update, Logtail is automatically uninstalled and then reinstalled. The original files in the installation directory are deleted. Before you update Logtail, we recommend that you back up the files.

  • If you want to update Logtail for 32-bit Windows to Logtail for 64-bit Windows in a 64-bit Windows operating system, you must uninstall Logtail for 32-bit Windows and then reinstall Logtail for 64-bit Window.

Start and stop Logtail

  1. Log on to your server.

  2. Choose Start Menu > Control Panel > Administrative Tools > Services.

  3. In the Services dialog box, select the service that you want to manage.

    • For Logtail V0.x.x.x, select LogtailWorker.

    • For Logtail V1.0.0.0 or later, select LogtailDaemon.

  4. Right-click the service and select Start, Stop, or Restart.

Uninstall Logtail

Run Windows PowerShell or Command Prompt as an administrator. Go to the logtail_installer directory, which contains the files extracted from the installation package. Then, run the following command to uninstall Logtail:

.\logtail_installer.exe uninstall

After Logtail is uninstalled, the Logtail installation directory is deleted. However, some configuration files are retained in the C:\LogtailData directory. You can manually delete the files based on your business requirements. The following configuration files are retained:

  • checkpoint: contains information about the checkpoints that are generated by Logtail plug-ins. This file is generated only if Logtail plug-ins are used.

  • user_config.d: contains local collection configurations.

    JSON files are considered collection configurations. For example, /usr/local/ilogtail/user_log_config.json is considered a collection configuration.

  • logtail_check_point: contains information about the checkpoints that are generated by Logtail.

  • users: contains the user identifier files that are configured.

What to do next

Simple Log Service projects and servers belong to the same account and reside in the same region

The following figure shows the configuration process.

image

After Logtail is installed, you must create a machine group and specify a data source to configure Logtail. Then, you can use Logtail to collect logs. For more information, see Create an IP address-based machine group, Create a custom identifier-based machine group, and Collect text logs from servers.

Simple Log Service projects and servers belong to different accounts and reside in the same region

The following figure shows the configuration process.

image

After Logtail is installed, you must configure a user identifier, configure a custom identifier, create a machine group, and specify a data source to configure Logtail. Then, you can use Logtail to collect logs. For more information, see Configure a user identifier, Create a custom identifier-based machine group, Collect text logs from servers, and Use Logtail to collect logs across Alibaba Cloud accounts.

Simple Log Service projects and servers reside in different regions

The following figure shows the configuration process.

image

You must install Logtail by using the installation command that is created for the Internet type. After you install Logtail, you must configure a user identifier, create a machine group, and specify a data source to configure Logtail. Then, you can use Logtail to collect logs. For more information, see Configure a user identifier, Create an IP address-based machine group, Create a custom identifier-based machine group, and Collect text logs from servers.

If you download Logtail over the classic network or a VPC, you can modify the network parameters in the /usr/local/ilogtail/ilogtail_config.json file to configure Logtail and collect logs across regions.

  1. Modify the network parameters in the /usr/local/ilogtail/ilogtail_config.json file.

    For example, your project resides in the China (Chengdu) region and your ECS instance resides in the China (Hangzhou) region. Modify the parameters based on the following code:

    {
      "config_server_address" : "http://logtail.cn-chengdu.log.aliyuncs.com",
      "data_server_list" :
      [
        {
          "cluster" : "cn-chengdu",
          "endpoint" : "cn-chengdu.log.aliyuncs.com"
        }
      ],
      ...
    }
  2. Run the following command to restart Logtail:

    sudo /etc/init.d/ilogtaild restart

Appendix: Region names for Logtail installation

The following table describes the value of the ${your_region_name} variable for each region.

Region

City

Region ID

China (Qingdao)

Qingdao

cn-qingdao

China (Beijing)

Beijing

cn-beijing

China (Zhangjiakou)

Zhangjiakou

cn-zhangjiakou

China (Hohhot)

Hohhot

cn-huhehaote

China (Ulanqab)

Ulanqab

cn-wulanchabu

China (Hangzhou)

Hangzhou

cn-hangzhou

China (Shanghai)

Shanghai

cn-shanghai

China (Shenzhen)

Shenzhen

cn-shenzhen

China (Heyuan)

Heyuan

cn-heyuan

China (Guangzhou)

Guangzhou

cn-guangzhou

China (Chengdu)

Chengdu

cn-chengdu

China (Hong Kong)

Hong Kong, China

cn-hongkong

Singapore

Singapore

ap-southeast-1

Malaysia (Kuala Lumpur)

Kuala Lumpur

ap-southeast-3

Indonesia (Jakarta)

Jakarta

ap-southeast-5

Philippines (Manila)

Manila

ap-southeast-6

Thailand (Bangkok)

Bangkok

ap-southeast-7

Japan (Tokyo)

Tokyo

ap-northeast-1

South Korea (Seoul)

Seoul

ap-northeast-2

US (Silicon Valley)

Silicon Valley

us-west-1

US (Virginia)

Virginia

us-east-1

Germany (Frankfurt)

Frankfurt

eu-central-1

UK (London)

London

eu-west-1

UAE (Dubai)

Dubai

me-east-1