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

  • 具有由度量名称和键/值对标识的时间序列数据的多维数据模型
  • 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. Java和LWJGL的关于OpenAL的文章

    一.OpenAL的原理和基本概念: 1.1 OpenAL的架构 OpenAL的架构同样基于三个核心组件:Context(上下文).Source(声源)和Buffer(缓冲区).Context代表了音频 ...

  2. 运用Npcap库实现SYN半开放扫描

    Npcap 是一款高性能的网络捕获和数据包分析库,作为 Nmap 项目的一部分,Npcap 可用于捕获.发送和分析网络数据包.本章将介绍如何使用 Npcap 库来实现半开放扫描功能.TCP SYN 半 ...

  3. SMU Summer 2023 Contest Round 4

    SMU Summer 2023 Contest Round 4 A. Telephone Number 满足第一个8后面存在10个字符即可 #include <bits/stdc++.h> ...

  4. Vim 全局配置 / 设置鼠标模式

    新搞的 Linux (Debian) 上的 vim 一右击粘贴就变成 insert (Visual) 模式,上网查了一下,要 set mouse=,但是每次设置太麻烦了,另外我也想改一下全局配色. 定 ...

  5. 颗粒流 + Janssen 定律 + Bagnold 数

    对于 \(n\) 个球,易得有 \[\begin{array}{c} \displaystyle\frac\pi2>\theta_i>-\frac\pi2,\theta_1>\cdo ...

  6. win32 对话框模板添加加速键

    今天想在菜单中添加加速键的时候,因是用的对话框模板,不能接受WM_KEYDOWN消息, 在网上收了半天,都不理想,最后在看WM_COMMAND的时候发现有个 wparam的低位有个加速键标识 最后把这 ...

  7. armbian指令大全

    修复缺失内容 使用以下命令修复安装时缺失的内容: sudo apt --fix-broken install 使用 aptitude 安装软件 aptitude 是 Debian 及其衍生系统中功能强 ...

  8. TrueType 和 OpenType 的关系

    OpenType 和 TrueType 都是字体文件格式,它们用于在数字设备中存储和渲染文本.虽然这两种格式都广泛使用,但它们在设计和功能上有一些重要区别. TrueType 是由苹果公司和微软公司在 ...

  9. 禁止 SSH 传递 locale 环境变量

    SSH 在连接远程机器时默认会传递一些环境变量,其中就包括你本机的 locale 变量.这会导致远程机器的 locale 配置变成和你本地主机一样.有时候我们不希望这种行为,我们可以通过修改 SSH ...

  10. C# 模拟http请求出现 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作[windows服务器]

    系统里面用到C#模拟Http请求,上线到服务器后,发现日志中大量出现"由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作" 或"通常每个套接字地址(协议/网络地址/ ...