Hi Yun Documents

DataKit Host Installation Guide

Introduction

This guide provides instructions for installing DataKit on Linux/macOS and Windows systems. DataKit is a lightweight and efficient data collector agent that gathers telemetry data from various sources, including logs, metrics, and traces.

Installation Commands

Linux/macOS

To install DataKit on Linux or macOS, use the following commands. The installation script supports both bash and ash shells.

  1. Using bash:
DK_DATAWAY=https://datagateway.hicloud.guru?token=<TOKEN> bash -c "$(curl -L https://static.guance.com/datakit/install.sh)"

After the installation, you will see a success message in the terminal.

Windows

To install DataKit on Windows, use the PowerShell command line. Ensure you run PowerShell as an administrator.

  1. Open PowerShell as an administrator.
  2. Execute the following commands:
Remove-Item -ErrorAction SilentlyContinue Env:DK_*;
$env:DK_DATAWAY="https://datagateway.hicloud.guru?token=<TOKEN>";
Set-ExecutionPolicy Bypass -scope Process -Force;
Import-Module bitstransfer;
start-bitstransfer -source https://static.guance.com/datakit/install.ps1 -destination .install.ps1;
powershell ./.install.ps1;

Common Environment Variables

DK_DATAWAY

  • Usage: Specifies the DataWay address for sending collected data.
  • Example: DK_DATAWAY=https://datagateway.hicloud.guru?token=

DK_GLOBAL_HOST_TAGS

  • Usage: Sets global host tags for identifying data sources.
  • Example: DK_GLOBAL_HOST_TAGS=host=**datakit_hostname,host_ip=**datakit_ip

DK_GLOBAL_ELECTION_TAGS

  • Usage: Sets global election tags for project and cluster identification.
  • Example: DK_GLOBAL_ELECTION_TAGS=project=my-project,cluster=my-cluster

DK_DEF_INPUTS

  • Usage: Lists default enabled collectors.
  • Example: DK_DEF_INPUTS=cpu,mem,disk

DK_CLOUD_PROVIDER

  • Usage: Specifies the cloud provider (e.g., aliyun, aws, tencent, hwcloud, azure).
  • Example: DK_CLOUD_PROVIDER=aws

DK_USER_NAME

  • Usage: Specifies the user name under which DataKit runs.
  • Default: root

DK_LITE

  • Usage: Installs the simplified version of DataKit.
  • Example: DK_LITE=1

DK_LOG_LEVEL

  • Usage: Sets the log level (info or debug).
  • Example: DK_LOG_LEVEL=info

DK_HTTP_LISTEN

  • Usage: Specifies the network interface for DataKit's HTTP service.
  • Default: localhost

DK_HTTP_PORT

  • Usage: Specifies the port for DataKit's HTTP service.
  • Default: 9529
@2025 All rights reserved. Produced by First Wave Technology.