6.18 Pormetheus部署
最后更新于:2022-04-02 07:46:11
## Prometheus部署
```
# 支持2.26.0
ansible-playbook -i hosts/prometheus_hosts prometheus/promethues.yml -e '{"prometheus_version":"2.26.0"}' --tags install
# 同步配置
ansible-playbook -i hosts/prometheus_hosts prometheus/prometheus/promethues.yml -e '{"prometheus_version":"2.26.0"}' --tags set_config
# 清理
ansible-playbook -i hosts/prometheus_hosts prometheus/prometheus/promethues.yml -e '{"prometheus_version":"2.26.0"}' --tags clean_prometheus
# 服务启停
ansible-playbook -i hosts/prometheus_hosts prometheus/prometheus/promethues.yml -e '{"prometheus_version":"2.26.0"}' --tags start_prometheus
ansible-playbook -i hosts/prometheus_hosts prometheus/prometheus/promethues.yml -e '{"prometheus_version":"2.26.0"}' --tags stop_prometheus
```
## node_exporter部署
```
# 支持1.1.2
ansible-playbook -i hosts/prometheus_hosts prometheus/node_exporter/node_exporter.yml -e '{"node_exporter_version":"1.1.2"}' --tags install
# 启停服务
ansible-playbook -i hosts/prometheus_hosts prometheus/node_exporter/node_exporter.yml -e '{"node_exporter_version":"1.1.2"}' --tags start_node_exporter
ansible-playbook -i hosts/prometheus_hosts prometheus/node_exporter/node_exporter.yml -e '{"node_exporter_version":"1.1.2"}' --tags stop_node_exporter
# 清理服务
ansible-playbook -i hosts/prometheus_hosts prometheus/node_exporter/node_exporter.yml -e '{"node_exporter_version":"1.1.2"}' --tags clean_node_exporter
```
## pushgateway部署
```
# 支持1.4.0
ansible-playbook -i hosts/prometheus_hosts prometheus/pushgateway/pushgateway.yml -e '{"pushgateway_version":"1.4.0"}' --tags install
# 启停服务
ansible-playbook -i hosts/prometheus_hosts prometheus/pushgateway/pushgateway.yml -e '{"pushgateway_version":"1.4.0"}' --tags start_pushgateway
ansible-playbook -i hosts/prometheus_hosts prometheus/pushgateway/pushgateway.yml -e '{"pushgateway_version":"1.4.0"}' --tags stop_pushgateway
# 清理服务
ansible-playbook -i hosts/prometheus_hosts prometheus/pushgateway/pushgateway.yml -e '{"pushgateway_version":"1.4.0"}' --tags clean_pushgateway
```
';