这就是普罗米修斯处于的位置。普罗米修斯具有一个服务端,这个服务端提供两类服务,一个是主动poll数据的服务,一种是等待exporter端push数据。
这里有个玩意是exporter,那么什么是Exporter?
Exporter
广义上讲所有可以向Prometheus提供监控样本数据的程序都可以被称为一个Exporter。类比于Zabbix中的agent。
Exporter来源
一般社区会提供大部分的exporter,而有些则是一些大牛或者编程爱好者写的,目前Promthues社区官方提供了对以下编程语言的支持:Go、Java/Scala、Python、Ruby。同时还有第三方实现的如:Bash、C++、Common Lisp、Erlang,、Haskeel、Lua、Node.js、PHP、Rust等。
安装
这里不提供docker安装的教程,有兴趣的直接访问docker官网即可。
查询镜像
sudo docker search prometheus

拉取Docker镜像
选取start数最多的镜像
sudo docker pull prom/prometheus

不指定则会下载最新的版本。
sudo docker pull prom/node-exporter
sudo docker pull grafana/grafana
启动node-exporter
官方并不建议使用容器化部署node-exporter
The node_exporter is designed to monitor the host system. It’s not
recommended to deploy it as a Docker container because it requires
access to the host system.For situations where Docker deployment is needed, some extra flags
must be used to allow the node_exporter access to the host namespaces.Be aware that any non-root mount points you want to monitor will need
to be bind-mounted into the container.If you start container for host monitoring, specify path.rootfs
argument. This argument must match path in bind-mount of host root.
The node_exporter will use path.rootfs as prefix to access host
filesystem.
docker run -d -p 9100:9100 --name node_exporter \
--restart=always \
--net="host" \
--pid="host"

最低0.47元/天 解锁文章
726

被折叠的 条评论
为什么被折叠?



