1

我想用 Elasticsearch Topbeat 监控我的主机。但是在 Docker 容器中运行 Topbeat 似乎容器看不到主机的 FS,而只能看到使用 --volume 运行选项挂载的内容。例子 :

root$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       6.9G  2.0G  4.7G  30% /

root$ docker run --name Topbeat --net host --pid host --dns=127.0.0.1 --volume /var/log:/var/log frg-topbeat:latest

root$ docker exec -it Topbeat df -h
Filesystem      Size  Used Avail Use% Mounted on
none            6.9G  2.0G  4.7G  30% /
tmpfs           501M     0  501M   0% /dev
tmpfs           501M     0  501M   0% /sys/fs/cgroup
/dev/vda1       6.9G  2.0G  4.7G  30% /var/log       <-- I wanted to see the / mount point and not only /var/log
shm              64M     0   64M   0% /dev/shm

更新 1:Topbeat 监控的所有 FS 都来自 'mount' 命令:

root$ docker exec -it Topbeat /bin/bash 
root@tst-rpx-master-0:/# mount
...
/dev/vda1 on /var/log type ext3 (rw,relatime,errors=remount-ro,data=ordered)
/dev/vda1 on /etc/resolv.conf type ext3 (rw,relatime,errors=remount-ro,data=ordered)
/dev/vda1 on /etc/hostname type ext3 (rw,relatime,errors=remount-ro,data=ordered)
/dev/vda1 on /etc/hosts type ext3 (rw,relatime,errors=remount-ro,data=ordered)
...
4

0 回答 0