mysql-export 监控

摘要:
背景描述:Prometheus由kube Prometheus部署,即通过servicemonitor的方式监控新的监控项目。

背景说明

prometheus 使用的是kube-prometheus 部署的,也就是通过servicemonitor 的方式监控新的监控项目。mysql export 插件通过helm 部署的 pod  service servicemonitor 等资源。

mysql-export 安装配置

通过helm 形式部署

添加仓库,下载包

helm repo add  azure http://mirror.azure.cn/kubernetes/charts/

helm repo update

helm pull azure/prometheus-mysql-exporter

tar -xvf prometheus-mysql-exporter-0.7.1.tgz

配置

cp prometheus-mysql-exporter/values.yaml  prometheus-mysql-exporter/values-117.yaml 

vi prometheus-mysql-exporter/values-117.yaml 

serviceMonitor:
  # enabled should be set to true to enable prometheus-operator discovery of this service
  enabled: true
  # interval is the interval at which metrics should be scraped
  interval: 30s
  # scrapeTimeout is the timeout after which the scrape is ended
  scrapeTimeout: 10s
  # additionalLabels is the set of additional labels to add to the ServiceMonitor
  additionalLabels: {}
  jobLabel: ""
  targetLabels: []
  podTargetLabels: []
  metricRelabelings: []

mysql:
  db: ""
  host: "52.13.22.91"
  param: ""
  pass: "xxxxxxx"
  port: 3306
  protocol: ""
  user: "root"
  existingSecret: false

部署


helm install m91 prometheus-mysql-exporter -f prometheus-mysql-exporter/values-91.yaml      ( 注意此时的命名空间是默认的)

deployment    pod   service  endpoint   servicemonitor  一并创建了

验证

mysql-export 监控第1张

免责声明:文章转载自《mysql-export 监控》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇mui 上拉刷新加载template数据C#编程技巧之钩子函数的使用——SetWindowsHookEx下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

批处理命令篇--配置免安装mysql

免安装版的mysql是进行软件绿色发布的绝佳助手,本文介绍一种使用批处理命令自动配置mysql的方法。 (1)建立三个文件,分别是:service install.bat,temp.txt,update.sql。 (2)在temp.txt文件中写入如下内容: set PathTemp= (3)在update.sql文件中写入如下内容: use mysql...

mysql in 子查询 效率慢 优化(转)

现在的CMS系统、博客系统、BBS等都喜欢使用标签tag作交叉链接,因此我也尝鲜用了下。但用了后发现我想查询某个tag的文章列表时速度很慢,达到5秒之久!百思不解(后来终于解决),我的表结构是下面这样的,文章只有690篇。 文章表article(id,title,content)标签表tag(tid,tag_name)标签文章中间表article_tag(...

shell 下执行mysql 命令

在shell开发中,很多时候我们需要操作mysql数据库(比如:查询数据、导出数据等),但是我们又无法进入mysql命令行的环境,就需要在shell环境中模拟mysql的环境,使用mysql相关命令,本文总结几种shell操作mysql的方法,供大家参考。 方案1 mysql-uuser-ppasswd-e"insertLogTablevalues(......

MySQL主从及主主环境部署

主从同步 主机环境 mysql的安装可以参考:https://www.cnblogs.com/brianzhu/p/8575243.htmlCentos7版本master:192.168.192.128 slave: 192.168.192.129 注意下面几点:1)要保证同步服务期间之间的网络联通。即能相互ping通,能使用对方授权信息连接到对方数据库(...

pyspider安装

操作系统 CentOS Linux release 7.0.1406 (Core) Python环境 Python安装   安装依赖:yum install gcc # 安装python必须yum install zlib # 以下四个安装setuptools必须,如果安装在python后,则需要重新make pythonyum install zlib...

使用logstash同步Mysql数据表到ES的一点感悟

针对单独一个数据表而言,大致可以分如下两种情况: 1.该数据表中有一个根据当前时间戳更新的字段,此时监控的是这个时间戳字段 具体可以看这个文章:https://www.cnblogs.com/sanduzxcvbnm/p/12858967.html 示例: modification_time就是表中要监控的时间戳字段 input { jdbc {...