普罗米修斯监控openGauss

普罗米修斯监控openGauss1、前期准备1.1项目依赖链接依赖开源工程工程链接普罗米修斯https://github.com/prometheus/pushgatewayopengauss_exporthttps://github.com/enmotech/opengauss_exporterpushgatewayhttps://github.com/prometheus/pushgatewayopenGausshttps://gitee.com/opengauss/openGauss

大家好,又见面了,我是你们的朋友全栈君。

1、前期准备

1.1项目依赖链接

依赖开源工程 工程链接
普罗米修斯 https://github.com/prometheus/pushgateway
opengauss_export https://github.com/enmotech/opengauss_exporter
pushgateway https://github.com/prometheus/pushgateway
openGauss https://gitee.com/opengauss/openGauss-server

1.2 工具包准备

系统环境 工具版本
ARM+openEuler prometheus-2.21.0.linux-arm64.tar.gz、pushgateway-1.2.0.linux-arm64.tar.gz、grafana-7.1.5-1.aarch64.rpm
X86+openEuler prometheus-2.21.0.linux-amd64.tar.gz、pushgateway-1.3.0.linux-amd64.tar.gz、grafana-7.2.1-1.x86_64.rpm

2、监控系统安装部署

2.1 tpmC采集和发送

''' 功能描述:在benchmarksql工具测试过程的输出信息通过tee命令 固定输出到/tmp/tpcc.log(便于在不同环境上部署),采集函数从/tmp/tpcc.log文件获取到tpmC值,发送函数将值发送到pushgateway服务。 '''
#日志信息采集并转换为tpmC
def collect_tpmc():
    log_file = "/tmp/tpcc.log"
    cmd = "tail -1 %s > /home/tpmc;awk -F ':' '{print $(NF-2)}' /home/tpmc | awk '{print $1}'" % log_file
    tpmc = os.popen(cmd).read().strip()
    tpmc = float(tpmc) * 0.45
    count_tpmc = "count_tpmc{count_tpmc=\"count_tpmc\"} " + str(tpmc) + "\n"
    print("count_tpmc : %s" %count_tpmc)
    return count_tpmc
#向pushgateway发送采集到的数据
def send_data(data_type, node):
    if data_type == "cpu":
        send_cmd = "cat {file_cpu} | curl --data-binary @- pushgateway_ip:port/metrics/job/{node}/instance/{data_type}".format(
            file_cpu=file_cpu, node=node, data_type=data_type)
    os.popen(send_cmd)

2.2 pushgateway的使用

cd pushgateway-1.2.0.linux-arm64
./pushgateway

​ 网页显示效果如下:
在这里插入图片描述

2.3 opengauss_exporter的使用

GO GET配置
git config --global http.proxy http://域账号:密码
git config --global https.proxy https://域账号:密码
git config --global http.sslverify false
git config --global https.sslverify false
GO MODULE配置
export GO111MODULE=on
export GOPROXY=http://***/
export GONOSUMDB=*

配置数据库白名单
host    all             all             ip      md5

配置启动opengauss_exporter
cd opengauss_exporter-master
make build
export DATA_SOURCE_NAME="postgresql://tpcc:******@ip:port/tpcc?sslmode=disable"
./bin/opengauss_exporter --config="og_exporter_default.yaml"
注:默认端口为9187

​ 启动效果
在这里插入图片描述

2.4 prometheus的使用

prometheus.yml 文件配置参考
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['prometheus_ip:9090']

  - job_name: 'pushgateway'
    static_configs:
    - targets: ['pushgateway_ip:9091']
      labels:
        instance: pushgateway

  - job_name: 'opgs_report'
    static_configs:
    - targets: ['opgs_report:9187']
      labels:
        instance: opgs_report
 
 #启动方式
 ./prometheus

​ 启动效果
在这里插入图片描述

2.5 grafana的使用

yum install grafana-7.1.5-1.aarch64.rpm
service grafana-server start

网访问prometheus_ip:3000
初始用户名密码均为admin

​ 数据源的配置
在这里插入图片描述
Dashboard的导入

openGauss_exporter工程 界面模板路径如下
opengauss_exporter-master\opengauss_exporter-master\dashboard\
模板也可根据自己需求灵活配置

​ 界面效果如下
在这里插入图片描述
tpmC显示panel的添加
在这里插入图片描述

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/161777.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 宿主机ping不通docker容器_kali虚拟机ping不通

    宿主机ping不通docker容器_kali虚拟机ping不通问题描述:  Docker网络模式分为四种,一般我们不设置时默认为bridge单桥模式,容器使用独立的networkNamespace,并连接到docker0虚拟网卡中。通过docker0网桥以及Iptablesnat表配置与宿主机通信。  此时在堡垒机上进行测试,利用busybox进行测试:#拉取镜像dockerpullbusybox#运行容器dockerrun-itd–namebusy_bridgebusybox  指令dockernetworkinspect

    2022年8月21日
    13
  • linux jdk安装步骤(下载安装jdk)

    1.linux虚拟机需要先连接互联网2.命令行下载jdk安装包3.jdk安装包解压安装及环境配置4.直接在线安装jdk并配置运行环境。1.查看yum库中都有哪些jdk版本(暂时只发现了openjdk)[root@localhost~]#yumsearchjava|grepjdk2.选择版本,进行安装//选择1.7版本进行安装[root@localhost~]#yuminstalljava-1.7.0-openjdk[root@localhost~]#yumins

    2022年4月11日
    76
  • 为ARM处理器实现Machine Forth「建议收藏」

    为ARM处理器实现Machine Forth「建议收藏」为ARM处理器实现MachineForth作者ReubenThomasComputerLaboratory,UniversityofCambridge23rdAugust1999摘要Fox和Moore[2]最近提出了一种新的Forth虚拟机模型,称为MachineForth。使用一个简单而具体的模型,据说它可以很容易地适应不同的硬件,不需要转向汇编

    2022年5月20日
    45
  • [ASP.net]web.config的customErrors与httpErrors的区别

    [ASP.net]web.config的customErrors与httpErrors的区别之前一直知道设置web.config(其实就是xml文件)的customErrors的error来指向自定义的错误页的URL,但是今天在调试的时候发现customErrors无法跳转到自定义的页面,在

    2022年7月1日
    29
  • 旁路由设置的正确方式

    旁路由设置的正确方式最近在玩旁路由,踩了一些坑,也学习了点相关知识,特整理记录下。一、旁路由的配置上图是旁路由的连接方式,一般作为旁路由的只有一个LAN口,可以把它想成一个普通的连接路由器的电脑。让他们ip在一个网段即可,比如主路由网关192.168.3.1,旁路由配置成192.168.3.21.主路由配置:DHCP配置,把网关和DNS改成旁路由ip地址,如192.168.3.2。2.旁路由配置:关闭DHCP,把网关改成主路由地址,如192.168.3.1,关闭桥接模式。这样配置后,网络流量如下图:.

    2022年6月14日
    54
  • 海思AI芯片(Hi3516DV300/CV500)开发(1.资料介绍)「建议收藏」

    海思AI芯片(Hi3516DV300/CV500)开发(1.资料介绍)「建议收藏」目录1、SVP资料介绍1.1SVP简介1.2开发框架1.3开发流程2、Hi3516DV300/CV500SDK内容介绍1、SVP资料介绍1.1SVP简介SVP(SmartVisionPlatform)是海思媒体处理芯片智能视觉异构加速平台。该平台包含了CPU、DSP、NNIE(NeuralNetworkInferenceEngine)等多个…

    2022年9月23日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号