普罗米修斯的主要特点是:

  • 具有由度量名称和键/值对标识的时间序列数据的多维数据模型
  • PromQL,一种灵活的查询语言, 可以利用这一维度
  • 不依赖分布式存储; 单个服务器节点是自治的
  • 时间序列集合通过HTTP上的拉模型发生
  • 推送时间序列通过中间网关支持
  • 通过服务发现或静态配置发现目标
  • 多种图形和仪表板支持模式

一、安装prometheus

系统环境:Centos7

版本:prometheus 2.54.1

二、下载安装包

直接下载官网的二进制包:https://www.prometheus.io/download/

三、开始安装

1、提前上传下载好的二进制安装包

2、解压安装包

# tar -zxvf prometheus-2.54.1.linux-amd64.tar.gz -C /usr/local/ #根据自己实际情况解压到指定目录

3、进入加压后的目录

# cd /usr/local/prometheus-2.54.1.linux-amd64

4、使用默认设置启动服务

# ./prometheus --config.file=prometheus.yml

默认使用9090端口启动,服务启动后,我们可以使用浏览器访问连接查看web端

http://192.168.31.155:9090 #改成自己的ip,首页很简单的

四、开始安装 exporter(被监控端,客户端)

1、exporter下载地址:

# wget https://github.com/prometheus/node_exporter/releases/download/v0.16.0-rc.3/node_exporter-0.16.0-rc.3.linux-amd64.tar.gz

2、解压,直接启动服务就ok了

# tar zxvf node_exporter-1.8.2.linux-amd64.tar.gz -C /usr/local

# cd /usr/local/node_exporter-1.8.2.linux-amd64

# ./node_exporter

2、在服务端配置,监控该客户端

# vi /usr/local/prometheus-2.54.1.linux-amd64/prometheus.yml

scrape_configs下面添加如下内容,格式一定要正确,有多台就按照此格式添加多个

- job_name: '192.168.31.156' # 任务名自己定义,唯一

static_configs:

- targets: ['192.168.31.156:9100'] #ip改成自己被监控端的ip

3、打开web端,status-》target查看被监控端详情

、安装Grafana
1.下载、解压
#wget https://dl.grafana.com/oss/release/grafana-7.0.1.linux-amd64.tar.gz
#tar -zxvf grafana-7.0.1.linux-amd64.tar.gz
#mv grafana-7.0.1.l /usr/local/
#ln -s /usr/local/grafana-7.0.1/ /usr/local/grafana

2.创建grafana用户及数据存放目录
#useradd -s /sbin/nologin -M grafana
#mkdir /data/grafana
#chown -R grafana:grafana /usr/local/grafana
#chown -R grafana:grafana  /data/grafana/

3. 修改配置文件
修改 /usr/local/grafana/conf/defaults.ini 文件,配置为上面新建的数据目录。
data = /data/grafana/data
logs = /data/grafana/log
plugins = /data/grafana/plugins
provisioning = /data/grafana/conf/provisioning

.4 把grafana-server添加到systemd中,新增 grafana-server.service 文件,使用systemd来管理grafana服务

#touch /etc/systemd/system/grafana-server.service
#vi /etc/systemd/system/grafana-server.service

[Unit]
Description=Grafana
After=network.target

[Service]
User=grafana
Group=grafana
Type=notify
ExecStart=/usr/local/grafana/bin/grafana-server -homepath /usr/local/grafana
Restart=on-failure

[Install]
WantedBy=multi-user.target

#chmod +x /etc/systemd/system/grafana-server.service

5.启动grafana并将其设置开机自启

#mkdir /script 
#如果已经存在 #cd /script

#touch grafana_service.sh
#vi grafana_service.sh

systemctl daemon-reload
systemctl restart  grafana-server
systemctl status  grafana-server
systemctl enable  grafana-server

#chmod +x grafana_service.sh

#sh /script/grafana_service.sh

6.访问
http://192.168.31.158:3000/login

# ps -ef | grep grafana

注意:grafana 初始账号密码:admin/admin
http://192.168.31.158:3000 进入主页

安装完成,大功告成

注意:忘记grafana的admin密码重置命令

#cd /usr/local/grafana/bin

#grafana-cli admin reset-admin-password admin1234

好了,简易安装部署已完成,其它的配置会在以后的搭建测试博客中慢慢书写,谢谢关注,也可以去官网查看相关文档。

六.帮助文档
grafana 图表模板:https://grafana.com/grafana/dashboards
prometheus 文档:https://prometheus.io/docs/introduction/overview

Centos7安装部署prometheus的更多相关文章

  1. CentOS7安装部署Prometheus+Grafana (转)

    转自:https://www.jianshu.com/p/967cb76cd5ca 作为监控系统的后起之秀,prometheus的安装可谓非常简单,不需要第三方的依赖(数据库.缓存.PHP之类的).下 ...

  2. CentOS7安装部署zabbix3.4操作记录

    CentOS7安装部署zabbix3.4操作记录 1.安装前准备 1.1 查看centos的系统版本 [root@zabbix ~]# cat /etc/redhat-release CentOS L ...

  3. centos7 安装部署运行 Redis5

    原文:centos7 安装部署运行 Redis5 Redis5 下载与解压(官网: https://redis.io/download ) 下载命令:wget http://download.redi ...

  4. 容器centos7安装部署ansible

    容器centos7安装部署ansible centos镜像版本及ansible版本 centos:centos7.5.1804 ansible:2.9.11 启动容器并进入容器 docker run ...

  5. Centos7安装部署搭建gitlab平台、汉化

    Centos7安装部署搭建gitlab平台.汉化 安装环境要求:内存不要小于4G,否则后期web界面可能会报错 一.准备工作 1.1 查看系统版本 首先查询系统版本,下载Gitlab的对应版本 [ro ...

  6. centos7安装部署opentsdb2.4.0

    写在前面 安装HBase 在HBase中创建表结构 安装配置并启动opentsdb 写在前面 最近因为项目需要在读opentsdb的一部分源码,后面会做个小结分享出来.本人是不大喜欢写这种安装部署的文 ...

  7. centos7 安装部署 Jenkins

    Jenkins 安装部署 1. 安装资源下载 Jenkin镜像地址: http://mirrors.jenkins-ci.org/status.html 选择清华大学镜像地址下载rpm https:/ ...

  8. centos7安装部署SVN

      SVN介绍 SVN是个自由.开源的版本控制系统,绝大多数开源软件都使用SVN作为代码版本管理软件. SVN的官方网站http://subversion.apache.org/.目前SVN在开源社区 ...

  9. Centos7 安装部署Kubernetes(k8s)集群

    目录 一.系统环境 二.前言 三.Kubernetes 3.1 概述 3.2 Kubernetes 组件 3.2.1 控制平面组件 3.2.2 Node组件 四.安装部署Kubernetes集群 4. ...

  10. jumpserverv0.5.0 基于 CentOS7安装部署

    基于 CentOS 7 一步一步安装 Jumpserver 0.5.0 环境 系统: CentOS 7 IP: 192.168.244.144 关闭 selinux和防火墙 # CentOS 7 $ ...

随机推荐

  1. br4gOnB4ll靶机笔记

    br4gOnB4ll靶机笔记 这是一台vulnhub上的免费靶机,比较简单. 1.主机发现 主机发现 -sn 只做ping扫描,不做端口扫描 nmap -sn 192.168.84.1/24 Star ...

  2. 「TCP/UDP」一个端口号可以同时被两个进程绑定吗?

    一.1个端口号可以同时被两个进程绑定吗? 根据端口号的绑定我们分以下几种情况来讨论: 2个进程分别建立TCP server,使用同一个端口号8888 2个进程分别建立UDP server,使用同一个端 ...

  3. 20.从0学ARM-移植uboot支持exynos4412

    经过前面一章的学习,我们已经了解了什么是uboot,本章主要目的是如何编译和移植uboot,增加串口.网络.emmc等功能,让他支持exynos4412开发板. 一.移植步骤 1. Uboot配置 指 ...

  4. 零基础学习人工智能—Python—Pytorch学习(九)

    前言 本文主要介绍卷积神经网络的使用的下半部分. 另外,上篇文章增加了一点代码注释,主要是解释(w-f+2p)/s+1这个公式的使用. 所以,要是这篇文章的代码看不太懂,可以翻一下上篇文章. 代码实现 ...

  5. .net 环境使用 RabbitMQ ,由浅入深 【一】

    最近因为先开发的项目需要用到消息队列,因此捣鼓了一下市面上开源的消息队列. 原本听闻Rocketmq ,一开始用的是 RocketMQ,各种集群搭建完毕,消息发送什么的测试后,,但是结果因为 Rock ...

  6. web 3d 技术预研及数据可视化技术

    web 3D 技术 白纸一张,先理一理概念: webGL 是low level 库,three.js 是high level 库,一般只要理解webGL里的概念,实际用thee.js 开发更容易 3D ...

  7. 在 windows 上部署 django

    环境 Django 4.1.7 python 3.11.2 Apache 2.4.46 1:安装配置 Apache 1.1:下载 Apache Apache官方下载链接 按照系统版本选择对应的,以下是 ...

  8. SpringBoot 引入第三方 jar

    SpringBoot 引入第三方 jar 项目结构 -BCJS |--lib |--hsm-talos-1.0.1.jar |--src |--pom.xml step1 : 配置第三方 jar 为依 ...

  9. 递归获取zip中的文件

    1 //tempPath 系统临时文件夹 2 2 private List<String> getWsContentList(String tempPath) { 3 3 //wsFile ...

  10. 嵌入式Linux ubi文件系统制作、分区设置、只读文件系统,uboot启动参数root

    当前平台, 基于君正的X10000平台的嵌入式Linux 系统 0  目的 我要设置根文件系统为可读写, 设置data分区上的文件系统为只读 1 设置各文件系统的读写属性 /bin/mount -o ...