资讯专栏INFORMATION COLUMN

普罗米修斯监控openGauss

Dogee / 2886人阅读

摘要:前期准备项目依赖链接依赖开源工程工程链接普罗米修斯工具包准备系统环境工具版本监控系统安装部署采集和发送功能描述在工具测试过程的输出信息通过命令固定输出到便于在不同环境上部署,采集函数从文件获取到值,发送函数将值发送到服务。

1、前期准备

1.1项目依赖链接

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

1.2 工具包准备

系统环境工具版本
ARM+openEulerprometheus-2.21.0.linux-arm64.tar.gz、pushgateway-1.2.0.linux-arm64.tar.gz、grafana-7.1.5-1.aarch64.rpm
X86+openEulerprometheus-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服务。"""#日志信息采集并转换为tpmCdef 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 falsegit config --global https.sslverify falseGO MODULE配置export GO111MODULE=onexport GOPROXY=http://***/export GONOSUMDB=*配置数据库白名单host    all             all             ip      md5配置启动opengauss_exportercd opengauss_exporter-mastermake buildexport 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=` 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.rpmservice grafana-server start网访问prometheus_ip:3000初始用户名密码均为admin

​ 数据源的配置

Dashboard的导入

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

​ 界面效果如下

tpmC显示panel的添加

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/124466.html

相关文章

  • 2021年8月国产数据库大事记

    摘要:本文整理了年月国产数据库大事件和重要产品发布消息。柏睿数据库加速安全卡面向全球重磅发布。月日,在全球数字经济大会成果发布会上,中国移动北京分公司与国产数据库领域新锐企业柏睿数据签署战略合作协议。本次大赛主要面向全国爱好数据库的高校学生。 本文整理了2021年8月国产数据库大事件和重要产品发布消息。目录8月国产数据库大事记TOP108月国产数据库大事记时间线产品/版本发布兼容认证8月排行榜新增...

    Scorpion 评论0 收藏0
  • 一些由 Prometheus 引出的闲言碎语

    摘要:普罗米修斯是谁在希腊神话中,是泰坦神族的神明之一,名字的意思是先见之明。普罗米修斯与智慧女神雅典娜共同创造了人类,普罗米修斯负责用泥土雕塑出人的形状,雅典娜则为泥人灌注灵魂,并教会了人类很多知识。普罗米修斯是谁?From Wikipedia:在希腊神话中,是泰坦神族的神明之一,名字的意思是先见之明。普罗米修斯与智慧女神雅典娜共同创造了人类,普罗米修斯负责用泥土雕塑出人的形状,雅典娜则为泥人灌...

    Tecode 评论0 收藏0
  • 2021年11月国产数据库排行榜:openGauss闯入前三,Kingbase流行度与日俱增,TDe

    摘要:年月国产数据库流行度排行榜前名达梦本月分数下跌,总分,位于榜单第二位。人大金仓保持增长态势,本月分数大幅上涨,总分,位于榜单第九位。达梦入选其中,位列总榜第国产数据库第。月日,人大金仓与天津科大正式签订联合人才培养协议。2021年11月国产数据库流行度排行榜前15名   达梦本月分数下跌10.88,总分467.45,位于榜单第二位。作为具有完全自主知识产权的国产数据库厂商,今年达梦的...

    waruqi 评论0 收藏0
  • 2021年10月国产数据库排行榜:达梦反超OceanBase夺榜眼,TDSQL实现“四连增”,数据生

    摘要:年月国产数据库流行度排行榜前名连续三个月的分数下跌让名次下降一位,以分的总分来到榜单第三。国产数据库流行度排行榜与趋势变化本月分数下跌,总分,位于榜单第五。 2021年10月国产数据库流行度排行榜前15名 连续三个月的分数下跌让OceanBase名次下降一位,以424.83分的总分来到榜单第三。本月,OceanBase有几个重要事件,如亮相2021中国国际服务贸易交流会,参与HICOO...

    vpants 评论0 收藏0
  • 2021年9月国产数据库大事记

    .markdown-body{word-break:break-word;line-height:1.75;font-weight:400;font-size:15px;overflow-x:hidden;color:#333}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body...

    suemi 评论0 收藏0

发表评论

0条评论

Dogee

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<