当前位置: 首页 > news >正文

网站前台后台常德经济技术开发区

网站前台后台,常德经济技术开发区,抚州做网站公司哪家好,衡水企业网站设计报价最近监控 mysql 数据库#xff0c;用了 pmm-server、pmm-client 发现监控是真的不太好用#xff0c;还是用回 prometheus 吧。 部署mysqld_exporter k8s 部署最新版本的 mysqld_exporter#xff0c;支持的数据库版本 MySQL 5.6、MariaDB 10.3。 先在数据库创建用…最近监控 mysql 数据库用了 pmm-server、pmm-client 发现监控是真的不太好用还是用回 prometheus 吧。 部署mysqld_exporter k8s 部署最新版本的 mysqld_exporter支持的数据库版本 MySQL 5.6、MariaDB 10.3。 先在数据库创建用户以及授权 CREATE USER exporter% IDENTIFIED BY XXXXXXXX WITH MAX_USER_CONNECTIONS 3; GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO exporter%; FLUSH PRIVILEGES;configmap mysqld_exporter 的配置文件 configmapcm.yaml apiVersion: v1 kind: ConfigMap metadata:name: mysqld-exporter-confignamespace: monitoring data:exporter.conf: |[client]user exporterpassword xxxxxxxx[client.servers]user exporterpassword xxxxxxxxdeployment\service mysqld_exporter 的 deployment 和 service yaml 文件deploy.yaml apiVersion: apps/v1 kind: Deployment metadata:name: mysqld-exporternamespace: monitoringlabels:app: mysqld-exporter spec:replicas: 1selector:matchLabels:app: mysqld-exportertemplate:metadata:labels:app: mysqld-exporterspec:containers:- name: mysqld-exporterimage: harbor.wenbo/dockerhub/prom/mysqld-exporter:v0.15.1ports:- containerPort: 9104resources:requests:memory: 1Gicpu: 0.5 volumeMounts:- name: config-volumemountPath: /etc/exporter.confsubPath: exporter.confargs:- --config.my-cnf/etc/exporter.confvolumes:- name: config-volumeconfigMap:name: mysqld-exporter-config--- apiVersion: v1 kind: Service metadata:name: mysqld-exporternamespace: monitoringlabels:app: mysqld-exporter spec:ports:- port: 9104targetPort: 9104protocol: TCPname: httpselector:app: mysqld-exportertype: NodePortprometheus 配置 在 prometheus 端你可以按如下方式设置抓取配置 - job_name: mysqld # To get metrics about the mysql exporter’s targetsparams:# Not required. Will match value to child in config file. Default value is client.auth_module: [client.servers]static_configs:- targets:# All mysql hostnames or unix sockets to monitor.- server1:3306- unix:///run/mysqld/mysqld.socklabels:mysql: alpha-master-72- targets:- server2:3306labels:mysql: alpha-slave1relabel_configs:- source_labels: [__address__]target_label: __param_target- source_labels: [__param_target]target_label: instance- target_label: __address__# The mysqld_exporter host:portreplacement: mysqld-exporter.monitoring.svc.cluster.local:9104 配置告警规则 这里用的是 kube-prometheus。配置了 最大连接数、mysql、io thread、sql thread状态等告警规则。mysqld-exporter-prometheusrule.yaml apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata:#labels:#prometheus: k8s#role: alert-rulesname: prometheusrule-mysqld-exporter-alertrulesnamespace: monitoring spec:groups:- name: mysqld-statusrules:- alert: MySQLMaxConnectionsexpr: (mysql_global_status_threads_connected / mysql_global_variables_max_connections) * 100 90for: 1mlabels:webhook: mysqlname: opsseverity: warningannotations:summary: MySQL 最大连接数达到了 90%description: 实例 {{$labels.instance}}mysql: {{$labels.mysql}}(目前使用:{{ printf %0.2f $value}}%)- alert: MySQLSlaveIOThreadDownexpr: mysql_slave_status_slave_io_running ! 1for: 1mlabels:webhook: mysqlname: opsseverity: warningannotations:summary: MySQL Slave I/O 线程停止description: 实例 {{$labels.instance }}mysql: {{$labels.mysql}}I/O 线程已经停止运行.- alert: MySQLSlaveSQLThreadDownexpr: mysql_slave_status_slave_sql_running ! 1for: 1mlabels:webhook: mysqlseverity: warningname: opsannotations:summary: MySQL Slave SQL 线程停止description: 实例 {{$labels.instance }}mysql: {{$labels.mysql}}SQL 线程已经停止运行.- alert: MySQLDownexpr: mysql_up ! 1for: 1mlabels:webhook: mysqlseverity: warningname: opsannotations:summary: mysql downdescription: 实例 {{$labels.instance }}, mysql: {{$labels.mysql}} down。- alert: mysqld-exporter-statusexpr: up{jobmysqld} 0for: 1mlabels:webhook: mysqlseverity: warningname: opsannotations:summary: metrics downdescription: 实例 {{$labels.instance }},mysql: {{$labels.mysql}} 数据源异常。
http://www.w-s-a.com/news/811710/

相关文章:

  • 手机网站调用分享wordpress.org移除
  • 工业和信息化部网站备案系统查询市场调研表模板
  • 网站流量转化线下推广活动有哪些
  • 030159网站建设与维护宝安网站公司
  • 个人网站备案网站内容做gif表情包网站
  • 湖南省建设厅城乡建设网站怎么建立一个网站网址
  • 图书馆网站建设的规章制度免费个人主页注册
  • 表格网站源码wordpress更换网站域名
  • 芜湖做网站多少钱做公司的网站的需求有哪些
  • 玉溪网站建设制作凌风wordpress百度云
  • 专业建网站价格门户网站建设 请示
  • 安徽省省博物馆网站建设佛山公司网站设计
  • 温州专业营销网站公司网络建设规划
  • 做模型常说的d站是什么网站wordpress 繁體
  • 给网站做h5缓存机制获取小程序api
  • 网站开发文档东莞市建设网站首页
  • 公共空间设计网站企业门户网站建设教程
  • 网站建设公司 深圳镇江建设质量监督站网站
  • 网站底部版权怎么做软广告经典案例
  • 网站收录突然全部没有了东莞网站建设公司电话
  • 境外企业网站推广免费ppt元素
  • 2018网站建设行业广东网站seo
  • 网站后台加密云服务器2008做网站
  • dw制作一个环保网站模板下载吉安网站建设收费
  • 深圳珠宝网站设计北京高端网站建设优势
  • 合肥企业制作网站wordpress创建网站
  • 织梦网站开发兼职wordpress 中间截取缩略图
  • 南通制作网站旅游搭建网站
  • 专业做商铺的网站个人网页html模板完整代码
  • 什么网站做美食最好最专业关键词推广是什么意思