CentOS7.4部署pushgateway

文章目录

  • 1.安装Pushgateway
  • 2.修改prometheus

1.安装Pushgateway

https://github.com/prometheus/pushgateway/releases/tag/v1.2.0

pushgateway-1.2.0.linux-amd64.tar.gz

解压:
tar -zxvf pushgateway-1.2.0.linux-amd64.tar.gz

重命名:
mv pushgateway-1.2.0.linux-amd64 pushgateway

修改所属组:
groupadd prometheus
chown -R prometheus:prometheus pushgateway

设置启动项:
vim /usr/lib/systemd/system/pushgateway.service

[Unit]
Description=pushgateway
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=prometheus
ExecStart=/opt/pushgateway/pushgateway
Restart=on-failure

[Install]
WantedBy=multi-user.target

启动:
systemctl daemon-reload
systemctl start pushgateway.service
systemctl status pushgateway.service
systemctl enable pushgateway.service
systemctl is-enabled pushgateway.service

访问:
http://IP:9091/
CentOS7.4部署pushgateway_第1张图片

2.修改prometheus

修改prometheus配置:
cd /opt/prometheus
vim cfg/prometheus.yml

- job_name: 'pushgateway'
    static_configs:
    - targets: ['master.prometheus:9091']

重启prometheus:
systemctl restart prometheus.service

CentOS7.4部署pushgateway_第2张图片

你可能感兴趣的:(Pushgateway,pushgateway)