匿名
未登录
登录
Linux78|wiki
搜索
查看“Centos安装promethues”的源代码
来自Linux78|wiki
名字空间
页面
讨论
更多
更多
页面选项
查看
查看源代码
历史
←
Centos安装promethues
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
wiki:用户|用户
您可以查看与复制此页面的源代码。
https://prometheus.io/download/ wget https://github.com/prometheus/prometheus/releases/download/v2.14.0/prometheus-2.14.0.linux-amd64.tar.gz useradd prometheus -s /sbin/nologin tar zxvf prometheus-2.14.0.linux-amd64.tar.gz -C /usr/local ln -sv /usr/local/prometheus-2.14.0.linux-amd64 /usr/local/prometheus useradd -s /sbin/nologin -M prometheus mkdir /data/prometheus -p chown -R prometheus:prometheus /usr/local/prometheus/ chown -R prometheus:prometheus /data/prometheus/ cat > /etc/systemd/system/prometheus.service <<-EOF [Unit] Description=Prometheus Documentation=https://prometheus.io/ After=network.target [Service] Type=simple User=prometheus ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus Restart=on-failure [Install] WantedBy=multi-user.target EOF systemctl start prometheus systemctl status prometheus systemctl enable prometheus prometheus启动后默认会启动9090端口 promtool来验证配置文件,这是Prometheus附带的一个代码校验工具。 ./promtool check config prometheus.yml Checking prometheus.yml SUCCESS: 0 rule files found === 过滤收集器 === Node Exporter可以返回很多指标,也许你并不想把它们全部收集上来。除了通过本地配置来控制Node Exporter在本地运行哪些收集器之外,Prometheus还提供了一种方式来限制收集器从服务器端实际抓取的数据,尤其是在你无法控制正抓取的主机的配置时,这种方式非常有帮助。 Prometheus通过添加特定收集器列表来实现作业配置。 static_configs: - targets: ['192.168.0.31:9100'] params: collect[]: - cpu - meminfo - diskstats - netdev - filedfd - filesystem - xfs - systemd 将被抓取的指标限制在上面的收集器列表中,使用params块中的collect[]列表指定,然后将它们作为URL参数传递给抓取请求。可以使用Node Exporter实例上的curl命令来对此进行测试。 curl -g -X GET http://192.168.0.60:9100/metrics?collect[]=cpu 这将返回Node Exporter基本指标,例如我们在Prometheus服务器上看到的Go指标,以及CPU收集器生成的指标,所有其他指标都将被忽略。 [[分类:Prometheus]] 返回: [[Prometheus]]
返回至
Centos安装promethues
。
导航
导航
首页
最近更改
随机页面
栏目
Nginx
Kubernetes
Spring Cloud
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志