1. 首先去prometheus官网下载了安装包
https://prometheus.io/download/
2. 上传安装包到服务器,然后解压
解压之后的文件如上图所示
./prometheus --help #查看命令
./prometheus # 启动prometheus服务
3. 浏览器访问prometheus提供的UI界面
http://192.168.79.132:9090/graph
4. 将prometheus注册成系统服务(centos7)
cd /lib/systemd/system
创建文件prometheus.service
vim prometheus.service
在prometheus.service中添加如下内容:
[Unit] Description=prometheus [Service] Restart=on-failure ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml
然后加载配置
systemctl daemon-reload
测试promethues.service安装是否成功
systemctl status prometheus.service # 查看服务状态 systemctl start prometheus.service # 启动prometheus服务
至此prometheus服务安装算是完成!
日拱一卒无有尽,功不唐捐终入海