最近公司需要新建监控平台,本文做thanos的prometheus高可用实验,实现如下图
1.thanos sidecar实现
- systemctl命令启动
vi /etc/systemd/system/thanos_sidecar.service
[Unit]
Description=Thanos SideCar
After=network.target
[Service]
Type=simple
User=root
ExecStart=/root/prometheus/thanos/thanos sidecar --prometheus.url=http://192.168.56.102:9090 --tsdb.path=/var/lib/prometheus/ --objstore.config-file=/root/prometheus/thanos/conf/bucket_config.yaml
Restart=on-failure
[Install]
WantedBy=multi-user.target
启动
systemctl start thanos_sidecar
systemctl enable thanos_sidecar
systemctl status thanos_sidecar
- nohup命令启动