Prometheus安装
Posted python-k8s
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Prometheus安装相关的知识,希望对你有一定的参考价值。
环境
系统:CentOS 7.5
软件:prometheus-2.18.1.linux-amd64.tar.gz
安装
-
下载二进制包
地址:https://prometheus.io/download/ -
安装
# tar -xzvf prometheus-2.18.1.linux-amd64.tar.gz # mkdir /usr/local/prometheus # mv prometheus-2.18.1.linux-amd64 /usr/local/prometheus/prometheus
-
创建数据目录
# mkdir -p /data/prometheus/prometheus/data
-
创建用户并授权
# useradd prometheus # chown -R prometheus:prometheus /usr/local/prometheus /data/prometheus
启动
-
添加启动服务
# vim /usr/lib/systemd/system/prometheus.service [Unit] Description= Prometheus After=network.target [Service] Type=simple User=prometheus ExecStart=/usr/local/prometheus/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus/prometheus/data ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure [Install] WantedBy=multi-user.target
-
启动
# systemctl enable prometheus.service # systemctl start prometheus.service
-
访问
web地址:http://ip:9090
以上是关于Prometheus安装的主要内容,如果未能解决你的问题,请参考以下文章