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

企业网站建设方案费用预算所有代刷平台推广

企业网站建设方案费用预算,所有代刷平台推广,做影视网站能赚到钱吗,石景山网站建设好的公司最近监控 mysql 数据库,用了 pmm-server、pmm-client 发现监控是真的不太好用,还是用回 prometheus 吧。 部署mysqld_exporter k8s 部署最新版本的 mysqld_exporter,支持的数据库版本 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 的配置文件 configmap,cm.yaml

apiVersion: v1
kind: ConfigMap
metadata:name: mysqld-exporter-confignamespace: monitoring
data:exporter.conf: |[client]user = exporterpassword = xxxxxxxx[client.servers]user = exporterpassword = xxxxxxxx
deployment\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: "1Gi"cpu: "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: NodePort

prometheus 配置

在 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: 'mysql'name: 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: "mysql"name: 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: 'mysql'severity: warningname: opsannotations:summary: "MySQL Slave SQL 线程停止"description: "实例 {{$labels.instance }},mysql: {{$labels.mysql}},SQL 线程已经停止运行."- alert: MySQLDownexpr: mysql_up != 1for: 1mlabels:webhook: 'mysql'severity: warningname: opsannotations:summary: "mysql down"description: "实例 {{$labels.instance }}, mysql: {{$labels.mysql}} down。"- alert: mysqld-exporter-statusexpr: up{job="mysqld"} == 0for: 1mlabels:webhook: 'mysql'severity: warningname: opsannotations:summary: "metrics down"description: "实例 {{$labels.instance }},mysql: {{$labels.mysql}} 数据源异常。"

http://www.hkea.cn/news/254897/

相关文章:

  • 大学生活动网站开发文案苏州seo门户网
  • 阿里云认证网站建设题库seo助理
  • 凤岗网站仿做靠谱seo外包定制
  • xampp安装wordpress说明徐州seo外包
  • 啥网站都能看的浏览器下载百度收录查询工具
  • 福田附近公司做网站建设哪家效益快奶糖 seo 博客
  • 临沂免费自助建站模板品牌整合营销
  • iis做本地视频网站找客户资源的网站
  • 做调查用哪个网站网络推广有多少种方法
  • 开发一个交易网站多少钱在线工具
  • 网站平台怎么建立的软文范例
  • 移动应用开发专业学什么东莞seo软件
  • 做宣传网站的公司手机百度极速版app下载安装
  • 私人可以做慈善网站吗外贸如何推广
  • 网站页面模板页面布局如何成为百度广告代理商
  • 瑞安外贸网站建设曲靖百度推广
  • 先做网站还是服务器销售营销方案100例
  • 用卫生纸做的礼物街网站免费网页空间到哪申请
  • 手游网站做cpc还是cpm广告号厦门网页搜索排名提升
  • 人个做外贸用什么网站好宁波百度seo点击软件
  • 诈骗网站怎么做的企业网站seo案例分析
  • 如何做网站接口湖南营销型网站建设
  • 进入兔展网站做PPt软文营销ppt
  • app网站新闻危机公关
  • 东莞关键词优化实力乐云seo南宁seo外包服务商
  • 做网站都是用源码么免费注册个人网站不花钱
  • 建设网站需要两种服务支持官网设计公司
  • 安庆做网站seo建站收费地震
  • 绵阳住房和城市建设局网站官网seo排名优化联系13火星软件
  • 网站开发建设费用关键词异地排名查询