Skip to content

Docker Installation

Choose DataWay Data Gateway Address

DataWay is the data gateway of Guance. Collectors reporting data to Guance must pass through the DataWay gateway.

Install DataKit Using Container

sudo docker run \
    --hostname "$(hostname)" \
    --workdir /usr/local/datakit \
    --name datakit-docker \
    -v "/host/conf/dir":"/usr/local/datakit/conf.d/host-inputs-conf" \
    -v "/":"/rootfs" \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e ENV_DATAWAY="https://openway.guance.com?token=tkn_7f5********fda8681" \
    -e ENV_GLOBAL_HOST_TAGS="" \
    -e ENV_HTTP_LISTEN="0.0.0.0:9529" \
    -e HOST_PROC="/rootfs/proc" \
    -e HOST_SYS="/rootfs/sys" \
    -e HOST_ETC="/rootfs/etc" \
    -e HOST_VAR="/rootfs/var" \
    -e HOST_RUN="/rootfs/run" \
    -e HOST_DEV="/rootfs/dev" \
    -e HOST_ROOT="/rootfs" \
    --cpus 2 \
    --memory 1g \
    --privileged \
    --publish 9529:9529 \
    -d \
    pubrepo.guance.com/datakit/datakit:1.86.2

During the installation phase, you can define some DataKit configurations by adding environment variables to the installation command.

View more environment variables.

Common Configurations

  • Choose the host directory. For example: /host/conf/dir;
  • Choose the host port. For example: 9529;
  • Define the DataKit name. For example: datakit-docker;
  • Choose the DataKit version to install (Deployment Plan requires specification);
  • Add global host tags, separate multiple tags with English commas. For example: host=datakit_hostname;
  • Specify the collectors to be enabled. By default, some host-related collectors are enabled. For example: cpu, mem, disk.

RUM & HTTP

  • Configure the DataKit HTTP service address (❗️If using RUM functionality, configure it as a public network accessible address). For example: localhost;

  • Choose whether to enable the RUM collector;

  • Choose whether to install the IP geolocation database;

  • Choose whether to disable the DataKit 404 page.

APM

Choose whether to enable the DDTrace collector.

DCA

Choose whether to enable the DCA service.

Using DataKit

After installation is complete, execute the command to check the running status of DataKit:

docker exec -it <container name or container ID> datakit monitor

Container Runtime Parameter Description

Parameter Description
--hostname Use the host's hostname as the hostname for the running DataKit. If you need to run multiple DataKits on the current host, you can add an appropriate suffix, for example: --hostname "$(hostname)-dk1"
--workdir Set the container working directory
-v Various host file mounts, used for the container to access host system resources
-e Various environment variable configurations for the DataKit runtime
--publish To receive external Trace data, etc., map the DataKit container's HTTP port (default 9529) to the host. When configuring the data sending address, please point to the host's IP and port 9529

Feedback

Is this page helpful? ×