概述
1.prometheus 部署
cd /home/nflow/server wget https://github.com/prometheus/prometheus/releases/download/v2.0.0/prometheus-2.0.0.linux-amd64.tar.gz tar xf prometheus-2.0.0.linux-amd64.tar.gz mv prometheus-2.0.0.linux-amd64 prometheus vim /usr/lib/systemd/system/prometheus.service [Unit] Description=Prometheus Documentation=https://prometheus.io/ After=network.target [Service] Type=simple User=nflow ExecStart=/home/nflow/servers/prometheus/prometheus --config.file=/home/nflow/servers/prometheus/prometheus.yml --storage.tsdb.path=/home/nflow/servers/prometheus/data Restart=on-failure [Install] WantedBy=multi-user.target sed -i '#localhost#0.0.0.0#' /home/nflow/server/prometheus/prometheus.yml chmod +x /usr/lib/systemd/system/prometheus.service systemctl enable prometheus.service systemctl start prometheus.service
2.node_exporter部署
wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0-rc.0/node_exporter-0.17.0-rc.0.linux-amd64.tar.gz tar xf node_exporter-0.17.0-rc.0.linux-amd64.tar.gz -C /home/nflow/servers cd /home/nflow/servers mv node_exporter-0.17.0-rc.0.linux-amd64 node_exporter vim /usr/lib/systemd/system/node_exporter.service [Unit] Description=node_exporter Documentation=https://prometheus.io/ After=network.target [Service] Type=simple User=nflow ExecStart=/home/nflow/servers/node_exporter/node_exporter Restart=on-failure [Install] WantedBy=multi-user.target systemctl start node_exporter systemctl enable node_exporter
[root@ch11 software]# cat /home/nflow/servers/prometheus/prometheus.yml global: scrape_interval: 15s evaluation_interval: 15s alerting: alertmanagers: - static_configs: - targets: rule_files: scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['0.0.0.0:9090'] - job_name: '172.16.10.11' #下面几行新添加的 static_configs: - targets: ['172.16.10.11:9100'] systemctl restart prometheus
3. grafana部署
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.3.2-1.x86_64.rpm yum localinstall -y grafana-5.3.2-1.x86_64.rpm systemctl enable grafana-server systemctl start grafana-server
234234
本文一部分参考:
https://www.cnblogs.com/netonline/p/8289411.html
转载于:https://blog.51cto.com/wsxxsl/2313980
最后
以上就是忧郁毛豆为你收集整理的Prometheus的全部内容,希望文章能够帮你解决Prometheus所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复