【openGauss服务器端工具的使用】

news2024/9/23 21:20:53

【openGauss服务器端工具的使用】

  1. gs_checkperf

    openGauss 不仅提供了gs_checkperf工具来帮助用户了解openGauss的负载情况。

    • 使用数据库安装用户登录服务器,执行如下命令进行查看数据库性能:
      简要信息展示:
      [omm@opengauss03 ~]$ gs_checkperf  -i PMK
      Cluster statistics information:
          Host CPU busy time ratio                     :    1.70       %  
          MPPDB CPU time % in busy time                :    91.66      %
          Shared Buffer Hit ratio                      :    99.80      %
          In-memory sort ratio                         :    0
          Physical Reads                               :    431
          Physical Writes                              :    455
          DB size                                      :    34         MB
          Total Physical writes                        :    455
          Active SQL count                             :    4
          Session count                                :    6
      
      
      详细信息展示
      [omm@opengauss03 ~]$ gs_checkperf -i PMK --detail
      Cluster statistics information:
      Host CPU usage rate:
          Host total CPU time                          :    33179390.000 Jiffies
          Host CPU busy time                           :    568840.000 Jiffies
          Host CPU iowait time                         :    18830.000  Jiffies
          Host CPU busy time ratio                     :    1.71       %
          Host CPU iowait time ratio                   :    .06        %
      MPPDB CPU usage rate:
          MPPDB CPU time % in busy time                :    89.78      %
          MPPDB CPU time % in total time               :    1.54       %
      Shared buffer hit rate:
          Shared Buffer Reads                          :    451
          Shared Buffer Hits                           :    178772
          Shared Buffer Hit ratio                      :    99.75      %
      In memory sort rate:
          In-memory sort count                         :    0
          In-disk sort count                           :    0
          In-memory sort ratio                         :    0
      I/O usage:
          Number of files                              :    97
          Physical Reads                               :    421
          Physical Writes                              :    320
          Read Time                                    :    6167       ms
          Write Time                                   :    3547       ms
      Disk usage:
          DB size                                      :    34         MB
          Total Physical writes                        :    320
          Average Physical write                       :    90217.08
          Maximum Physical write                       :    320
      Activity statistics:
          Active SQL count                             :    4
          Session count                                :    6
      Node statistics information:
      dn_6001:
          MPPDB CPU Time                               :    510710     Jiffies
          Host CPU Busy Time                           :    568840     Jiffies
          Host CPU Total Time                          :    33179390   Jiffies
          MPPDB CPU Time % in Busy Time                :    89.78      %
          MPPDB CPU Time % in Total Time               :    1.54       %
          Physical memory                              :    2606247936 Bytes
          DB Memory usage                              :    4896587776 Bytes
          Shared buffer size                           :    268435456  Bytes
          Shared buffer hit ratio                      :    99.75      %
          Sorts in memory                              :    0
          Sorts in disk                                :    0
          In-memory sort ratio                         :    0
          Number of files                              :    97
          Physical Reads                               :    421
          Physical Writes                              :    320
          Read Time                                    :    6167
          Write Time                                   :    3547
      Session statistics information(Top 10):
      Session CPU statistics:
      1 dn_6001-postgres-omm:
          Session CPU time                             :    3
          Database CPU time                            :    510760
          Session CPU time %                           :    0.00       %
      2 dn_6001-postgres-omm:
          Session CPU time                             :    0
          Database CPU time                            :    510760
          Session CPU time %                           :    0.00       %
      3 dn_6001-postgres-omm:
          Session CPU time                             :    0
          Database CPU time                            :    510760
          Session CPU time %                           :    0.00       %
      4 dn_6001-postgres-omm:
          Session CPU time                             :    0
          Database CPU time                            :    510760
          Session CPU time %                           :    0.00       %
      
      Session Memory statistics:
      1 dn_6001-postgres-omm:
          Buffer Reads                                 :    1607
          Shared Buffer Hit ratio                      :    93.05
          In Memory sorts                              :    0
          In Disk sorts                                :    0
          In Memory sorts ratio                        :    0
          Total Memory Size                            :    6566592
          Used Memory Size                             :    5338376
      2 dn_6001-postgres-omm:
          Buffer Reads                                 :    283
          Shared Buffer Hit ratio                      :    100.00
          In Memory sorts                              :    0
          In Disk sorts                                :    0
          In Memory sorts ratio                        :    0
          Total Memory Size                            :    6542016
          Used Memory Size                             :    5281600
      3 dn_6001-postgres-omm:
          Buffer Reads                                 :    39
          Shared Buffer Hit ratio                      :    100.00
          In Memory sorts                              :    0
          In Disk sorts                                :    0
          In Memory sorts ratio                        :    0
          Total Memory Size                            :    5518016
          Used Memory Size                             :    5055232
      4 dn_6001-postgres-omm:
          Buffer Reads                                 :    1023
          Shared Buffer Hit ratio                      :    100.00
          In Memory sorts                              :    1
          In Disk sorts                                :    0
          In Memory sorts ratio                        :    100.00
          Total Memory Size                            :    11617840
          Used Memory Size                             :    9327632
      
      Session IO statistics:
      1 dn_6001-postgres-omm:
          Physical Reads                               :    120
          Read Time                                    :    2383
      2 dn_6001-postgres-omm:
          Physical Reads                               :    0
          Read Time                                    :    0
      3 dn_6001-postgres-omm:
          Physical Reads                               :    0
          Read Time                                    :    0
      4 dn_6001-postgres-omm:
          Physical Reads                               :    0
          Read Time                                    :    0
      
      
  2. gs_collector

    数据库运行时,某些操作在执行过程中可能会出现错误,数据库依然能够运行。但是此时数据库中的数据可能已经发生不一致的情况。建议检查openGauss运行日志,及时发现隐患。
    当openGauss发生故障时,使用 gs_collector 此工具收集OS信息、日志信息以及配置文件等信息,来定位问题。

    • 设置收集配置文件,新建collector.json文件,添加如下内容:

      {
          "Collect": [
              {
                  "Content": "RunTimeInfo,HardWareInfo",
                  "Count": "1",
                  "Interval": "0",
                  "TypeName": "System"
              },
              {
                  "Content": "Coordinator,DataNode,Gtm,ClusterManager",
                  "Count": "1",
                  "Interval": "0",
                  "TypeName": "Log"
              },
              {
                  "Content": "pg_locks,pg_stat_activity,pg_thread_wait_status",
                  "Count": "1",
                  "Interval": "0",
                  "TypeName": "Database"
              },
              {
                  "Content": "Coordinator,DataNode,Gtm",
                  "Count": "1",
                  "Interval": "0",
                  "TypeName": "Config"
              }
          ]
      }
      
    • 执行如下命令进行信息收集:

      gs_collector --begin-time="20240103 07:00" --end-time="20240103 22:30" -C /home/omm/collector.json
      

      结果如下:

      Successfully parsed the configuration file.
      create Dir.
      Successfully create dir.
      do system check interval 0 : count 1
      Collecting OS information.
      The cmd is source /home/omm/.bashrc; python3 ‘/opt/install/om/script/local/LocalCollect.py’ -t system_check -U omm -l /opt/install/log/omm/omm/om/gs_local.log -C ‘{#Content#: #ps,ioStat,netFlow,spaceUsage,cpuInfo,memInfo,disk,#, #Count#: #1#, #Interval#: #0#, #TypeName#: #System#}’
      Failed to collect OS information.
      do database check interval 0 : count 1
      Collecting catalog statistics.
      Successfully collected catalog statistics.
      do log check interval 0 : count 1
      Collecting Log files.
      Successfully collected Log files.
      do Config check 0:1
      Collecting Config files.
      Successfully collected Config files.
      Collecting files.
      Successfully collected files.
      All results are stored in /opt/install/tmp/collector_20240103_214254.tar.gz.

      详细可查看结果文件,比如:

      [omm@opengauss03 ~]$ tar -zvxf /opt/install/tmp/collector_20240103_214254.tar.gz -C ./
      collector_20240103_214254/
      collector_20240103_214254/Detail.log
      collector_20240103_214254/opengauss03.tar.gz
      collector_20240103_214254/Summary.log
      [omm@opengauss03 ~]$ ll
      total 8.0K
      drwx------. 2 omm dbgrp 4.0K Jan 3 21:43 collector_20240103_214254
      -rw-------. 1 omm dbgrp 703 Jan 3 21:41 collector.json
      [omm@opengauss03 ~]$ cd collector_20240103_214254/
      [omm@opengauss03 collector_20240103_214254]$ ll
      total 84K
      -rw-------. 1 omm dbgrp 2.3K Jan 3 21:43 Detail.log
      -rw-------. 1 omm dbgrp 76K Jan 3 21:43 opengauss03.tar.gz
      -rw-------. 1 omm dbgrp 1.1K Jan 3 21:43 Summary.log
      [omm@opengauss03 collector_20240103_214254]$ cat Summary.log
      在这里插入图片描述

  3. gs_check

    gs_check改进增强,统一化当前系统中存在的各种检查工具,例如gs_check、gs_checkos等,帮助用户在openGauss运行过程中,全量的检查openGauss运行环境、操作系统环境、网络环境及数据库执行环境,也有助于在openGauss重大操作之前对各类环境进行全面检查,有效保证操作执行成功。具体可参考官网:gs_check

    • 示例如下:检查CPU\MTP\PING
      gs_check -i CheckCPU,CheckMTU,CheckPing
      
      结果如下:
      在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1353403.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【C语言】程序练习(四)

大家好,这里是争做图书馆扫地僧的小白。非常感谢各位的支持,也期待着您的关注。 目前博主有着C语言、C、linux以及数据结构的专栏,内容正在逐步的更新。 希望对各位朋友有所帮助同时也期望可以得到各位的支持,有任何问题欢迎私信与…

Rust 圣经 阅读 引用与借用

Rust 通过 借用(Borrowing) 在使用某个变量的指针或引用。 获取变量的引用,称之为 借用(borrowing) 。 引用与解引用 引用是为了解决在使用函数时,频繁地传递所有权。 引用只是获取了引用权,而…

QML —— Canvas重绘钟表组件(附完整源码)

示例效果] 源码 main.cpp #include <QGuiApplication> #include <QQmlApplicationEngine>int main(int argc, char *argv[]) {QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);QGuiApplication app(argc, argv);QQmlApplicationEngine engine;const…

Nacos学习思维导图

一、服务注册 参考文档&#xff1a;http://www.bryh.cn/a/118936.html https://blog.csdn.net/Saintmm/article/details/121981184 二、服务续约 参考文档&#xff1a;http://www.bryh.cn/a/118936.html https://blog.csdn.net/Saintmm/article/details/121981184 三、服务…

案例089:基于微信小程序的校园综合服务平台设计与实现

文末获取源码 开发语言&#xff1a;Java 框架&#xff1a;SSM JDK版本&#xff1a;JDK1.8 数据库&#xff1a;mysql 5.7 开发软件&#xff1a;eclipse/myeclipse/idea Maven包&#xff1a;Maven3.5.4 小程序框架&#xff1a;uniapp 小程序开发软件&#xff1a;HBuilder X 小程序…

cmd命令启动C# windows服务程序

因为Process.Manage.Service.exe程序为Windows服务程序&#xff0c;不能直接双击打开&#xff0c;所以需要借助windows系统自带InstallUtil.exe程序来启动它。 以管理员身份运行cmd命令控制台窗口 输入命令进入到InstallUtil.exe程序所在的文件夹 cd C:\Windows\Microsoft.NET…

鸿蒙开发第一天

一、开发准备工作 1、开发工具的安装 1&#xff09;下载地址&#xff1a;https://developer.huawei.com/consumer/cn/deveco-studio/ 2&#xff09;查询API文档链接&#xff1a;https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V2/syscap-00000014080893…

【操作系统xv6】学习记录2 -RISC-V Architecture

说明&#xff1a;看完这节&#xff0c;不会让你称为汇编程序员&#xff0c;知识操作系统的前置。 ref&#xff1a;https://binhack.readthedocs.io/zh/latest/assembly/mips.html https://www.bilibili.com/video/BV1w94y1a7i8/?p7 MIPS MIPS的意思是 “无内部互锁流水级的微…

手撕Vuex-vuex实现原理分析

本章节主要围绕着手撕 Vuex&#xff0c;那么在手撕之前&#xff0c;先来回顾一下 Vuex 的基本使用。 创建一个 Vuex 项目&#xff0c;我这里采用 vue-cli 创建一个项目&#xff0c;然后安装 Vuex。 vue create vuex-demo 选择 Manually select features。 这里只需要&#xff0…

莫比乌斯函数

积性函数定义 若gcd(p,q)1&#xff0c;有f(p*q)f(p)*f(q)&#xff0c;则f(x)是积性函数 其中规定f(1)1&#xff0c;对于积性函数有&#xff1a;所有的积性函数都可以用筛法求出 常见的积性函数有欧拉函数和莫比乌斯函数 筛法求莫比乌斯函数 const int N 1e9 5; const int …

哪些洗地机比较好?洗地机选购指南

随着社会生活水平的提高&#xff0c;人们对居家环境的卫生和清洁要求不断提升。家用洗地机作为一种先进的清洁工具&#xff0c;带来了许多便利和优势&#xff0c;特别是在解决一些特殊需求的家庭环境方面。 以下是一些家用洗地机的优势和适用场景&#xff1a; 1.高效清洁&…

[ Tool ] celery分布式任务框架基本使用

celery官方 Celery 官网&#xff1a;www.celeryproject.org/ Celery 官方文档英文版&#xff1a;docs.celeryproject.org/en/latest/i… Celery 官方文档中文版&#xff1a;docs.jinkan.org/docs/celery… Celery是一个简单、灵活且可靠的&#xff0c;处理大量消息的分布式系…

HackTheBox - Medium - Linux - Agile

Agile Agile 是一个中等难度的 Linux 机器&#xff0c;在端口 80 上有一个密码管理网站。创建帐户并添加几个密码后&#xff0c;发现网站的导出到 CSV 功能容易受到任意文件读取的攻击。其他终结点的枚举显示“/download”在访问时引发错误&#xff0c;并显示“Werkzeug”调试…

贪心算法part05 435无重叠区间

435无重叠区间 763 划分字母区间 56合并区间

什么是聚合支付,又能带来哪些好处?

随着科技的飞速发展&#xff0c;人们的支付方式也在不断地发生变革。从最初的现金支付、银行卡支付&#xff0c;到现在的移动支付、扫码支付等&#xff0c;支付方式已经变得越来越便捷。聚合支付作为一种新型的支付方式&#xff0c;也在逐渐改变着人们的生活方式。那么&#xf…

CSS 中间位置翻转动画

<template><div class"container" mouseenter"startAnimation" mouseleave"stopAnimation"><!-- 旋方块 --><div class"box" :class"{ rotate-hor-center: isAnimating }"><!-- 元素内容 -->…

一篇文章带你搞定Python所有内置函数

前言 Python 内置了许多的函数和类型&#xff0c;比如print()&#xff0c;input()等&#xff0c;我们可以直接在程序中使用它们&#xff0c;非常方便&#xff0c;并且它们是Python解释器的底层实现的&#xff0c;所以效率是比一般的自定义函数更有效率。目前共有71个内置函数&…

深入解析d3dcompiler_47.dll文件及其丢失的修复方法

一、d3dcompiler_47.dll是什么文件&#xff1f; d3dcompiler_47.dll是DirectX SDK中的一个动态链接库文件&#xff0c;它是用于编译DirectX着色器的工具之一。DirectX是由微软公司开发的一种多媒体编程接口&#xff0c;它提供了一系列的API和工具&#xff0c;用于开发游戏和多…

打造专业开发者指南:针对ShardingProxy分库分表解决策略的深度剖析 – 详解部署、使用、服务治理与优化技巧

一、 ShardingProxy快速使用 ShardingProxy的功能同样是分库分表&#xff0c;但是他是一个独立部署的服务端&#xff0c;提供 统一的数据库代理服务。注意&#xff0c;ShardingProxy目前只支持MySQL和PostgreSQL。并且&#xff0c;客户端连接ShardingProxy时&#xff0c;最好使…

java每日一题——双色球系统(答案及编程思路)

前言&#xff1a; 打好基础&#xff0c;daydayup! 题目&#xff1a;要求如下&#xff08;同时&#xff1a;红球每个号码不可以相同&#xff09; 编程思路&#xff1a;1&#xff0c;创建一个可以录入数字的数组&#xff1b;2&#xff0c;生成一个可以随机生成数字的数组&#xf…