当前位置:网站首页>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.gz
mv 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.target
systemctl daemon-reload
systemctl restart prometheus
ss -antl
centos6:
vim /usr/lib/systemd/system/prometheus.service
进入文件后添加上面命令中的内容,没有目录和文件需要创建
sudo chkconfig daemon-reload
service prometheus restart
三、启动prometheus命令
/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml &
或者
**** ./prometheus
四、网页上http://192.168.0.xxx:9090/targets能访问则成功。
边栏推荐
- Nebula Importer 数据导入实践
- What if the self incrementing ID of online MySQL is exhausted?
- 1、 Introduction to C language
- 一、C语言入门基础
- 完善的js事件委托
- C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
- Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
- repeat_P1002 [NOIP2002 普及组] 过河卒_dp
- 26. 删除有序数组中的重复项 C#解答
- Li Kou brush question diary /day4/6.26
猜你喜欢
基于unity的愤怒的小鸟设计
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
【2022年江西省研究生数学建模】水汽过饱和的核化除霾 思路分析及代码实现
Scala基础教程--19--Actor
What types of Thawte wildcard SSL certificates provide
使用canal配合rocketmq监听mysql的binlog日志
Wireshark抓包TLS协议栏显示版本不一致问题
Process of manually encrypt the mass-producing firmware and programming ESP devices
Build your own website (15)
神经网络物联网应用技术就业前景【欢迎补充】
随机推荐
Halcon模板匹配
Technology sharing | interface testing value and system
Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join
SSL证书续费相关问题详解
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Scala basic tutorial -- 20 -- akka
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
Caché WebSocket
大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
Scala basic tutorial -- 14 -- implicit conversion
vbs或vbe如何修改图标
2022年字节跳动日常实习面经(抖音)
使用FTP
[uniapp] uniapp development app online Preview PDF file
Li Kou brush question diary /day3/2022.6.25
Using SSH
Scala基础教程--17--集合
Pb extended DLL development (super chapter) (VII)