当前位置:网站首页>prometheus安装
prometheus安装
2022-07-04 17:40:00 【码道人】
首先查看当前服务器的centos的版本
cat /etc/centos-release以下分为centOs6和7的方法;
【//如果yum用不了则运行以下步骤,能使用则不用换源,上传安装包步骤为手动上传,也可以不用换
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
curl -k -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache】
一、官网下载软件包
https://prometheus.io/download/
上传程序包:(安装包文件里已下好,)
prometheus-2.14.0.linux-amd64.tar.gz
解压程序包:
tar xvf prometheus-2.14.0.linux-amd64.tar.gzmv prometheus-2.14.0.linux-amd64 /usr/local/prometheus运行Prometheus server:
cd /usr/local/prometheus./prometheus --config.file=prometheus.yml二、配置Prometheus
在Prometheus.yml中有配置文件,我们可以对其进行配置,当然第一次安装也可以不用配置;
vim /usr/local/prometheus/prometheus.yml校验配置文件
./promtool check config ./prometheus.yml配置service启动文件
centos7方法如下://
vim /usr/lib/systemd/system/prometheus.service添加内容
[Unit]
Description=The Prometheus Server
After=network.target
[Service]
Restart=on-failure
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml
RestartSec=15s
[Install]
WantedBy=multi-user.targetsystemctl daemon-reloadsystemctl restart prometheusss -antlcentos6:
vim /usr/lib/systemd/system/prometheus.service进入文件后添加上面命令中的内容,没有目录和文件需要创建
sudo chkconfig daemon-reloadservice prometheus restart三、启动prometheus命令
/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml &或者
**** ./prometheus四、网页上http://192.168.0.xxx:9090/targets能访问则成功。
边栏推荐
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- 模板_判断素数_开方 / 六素数法
- Nature Microbiology | 可感染阿斯加德古菌的六种深海沉积物中的病毒基因组
- 其他InterSystems %Net工具
- Process of manually encrypt the mass-producing firmware and programming ESP devices
- Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
- LeetCode 赎金信 C#解答
- 自由小兵儿
- 6.26cf simulation race e: solution to the problem of price maximization
- Download the first Tencent technology open day course essence!
猜你喜欢

Scala basic tutorial -- 13 -- advanced function

【uniapp】uniapp开发app在线预览pdf文件

一、C语言入门基础

Scala basic tutorial -- 19 -- actor

Li Kou brush question diary /day2/2022.6.24

Li Kou brush question diary /day3/2022.6.25

DeFi生态NFT流动性挖矿系统开发搭建

Nature Microbiology | 可感染阿斯加德古菌的六种深海沉积物中的病毒基因组

An example of multi module collaboration based on NCF

VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
随机推荐
Nature microbiology | viral genomes in six deep-sea sediments that can infect Archaea asgardii
How is the entered query SQL statement executed?
2022年字节跳动日常实习面经(抖音)
启牛开的证券账户安全吗?
从实时应用角度谈通信总线仲裁机制和网络流控
Other InterSystems%net tools
sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
技术分享 | 接口测试价值与体系
Rookie post station management system based on C language
每日一题(2022-07-02)——最低加油次数
6.26cf simulation match B: solution to array reduction problem
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
How to download files using WGet and curl
php伪原创api对接方法
奥迪AUDI EDI INVOIC发票报文详解
Download the first Tencent technology open day course essence!
Scala基础教程--12--读写数据
国元期货是正规平台吗?在国元期货开户安全吗?
使用SSH
2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import 'fmt' func