版本要求
docker cli安装
docker pull netdata/netdata
docker run -d --name=netdata \
--pid=host \
--network=host \
-v netdataconfig:/etc/netdata \
-v netdatalib:/var/lib/netdata \
-v netdatacache:/var/cache/netdata \
-v /:/host/root:ro,rslave \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /etc/localtime:/etc/localtime:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/os-release:/host/etc/os-release:ro \
-v /var/log:/host/var/log:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--cap-add SYS_ADMIN \
--security-opt apparmor=unconfined \
-e NETDATA_CLAIM_TOKEN=DqR3z_x5dwG39VEzhQJil8IHmUCf6bc3S8wvnOMUWuuk3cQqW09D9kO7zsPm08JbA0ywsleh9-jery3J6hTAm9kyL_XnPe7HFQS_X_KAiSGDguNZhTDGS_PObYs9qkgNGP98kbg \
-e NETDATA_CLAIM_URL=https://app.netdata.cloud \
-e NETDATA_CLAIM_ROOMS=a04ab163-00f0-4e7d-996e-102f3f23bf9c \
netdata/netdata:stable
docker compose安装:
version: '3'
services:
netdata:
image: netdata/netdata:stable
container_name: netdata
pid: host
network_mode: host
restart: unless-stopped
cap_add:
- SYS_PTRACE
- SYS_ADMIN
security_opt:
- apparmor:unconfined
volumes:
- netdataconfig:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /:/host/root:ro,rslave
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /etc/localtime:/etc/localtime:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
- /var/log:/host/var/log:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NETDATA_CLAIM_TOKEN=DqR3z_x5dwG39VEzhQJil8IHmUCf6bc3S8wvnOMUWuuk3cQqW09D9kO7zsPm08JbA0ywsleh9-jery3J6hTAm9kyL_XnPe7HFQS_X_KAiSGDguNZhTDGS_PObYs9qkgNGP98kbg
- NETDATA_CLAIM_URL=https://app.netdata.cloud
- NETDATA_CLAIM_ROOMS=a04ab163-00f0-4e7d-996e-102f3f23bf9c
volumes:
netdataconfig:
netdatalib:
netdatacache: