k8s prometheus 监控多个MySql -盖完後的新增

【YC的寻路青春】

上一篇已经有点太多了 容许我分两篇 不然有点爆炸

如果盖完之後 要增新的话
1.去资料库增加有process, replication权限的帐号

CREATE USER 'yc'@'%' IDENTIFIED BY 'yc';
grant process, replication client on *.* to 'yc'@'%';                  

2.deployment里面的livenessProbe的command增加

nohup mysqld_exporter
  --web.listen-address=$podIP:9107 --config.my-cnf=/etc/.90.cnf &
- /bin/sh
- '-c'
- >-
  nohup mysqld_exporter --web.listen-address=$podIP:9105
  --config.my-cnf=/etc/.57.cnf & nohup mysqld_exporter
  --web.listen-address=$podIP:9106 --config.my-cnf=/etc/.80.cnf
  & exit

变成

  nohup mysqld_exporter --web.listen-address=$podIP:9105
  --config.my-cnf=/etc/.57.cnf & nohup mysqld_exporter
  --web.listen-address=$podIP:9106 --config.my-cnf=/etc/.80.cnf
  & nohup mysqld_exporter --web.listen-address=$podIP:9107
  --config.my-cnf=/etc/.90.cnf &exit

3.service 多开port号

ports:
    - name: YCdata1
      protocol: TCP
      port: 9104
      targetPort: 9104
    - name: YCdata2
      protocol: TCP
      port: 9105
      targetPort: 9105
    - name: YCdata3
      protocol: TCP
      port: 9106
      targetPort: 9106

->

 ports:
    - name: YCdata1
      protocol: TCP
      port: 9104
      targetPort: 9104
    - name: YCdata2
      protocol: TCP
      port: 9105
      targetPort: 9105
    - name: YCdata3
      protocol: TCP
      port: 9106
      targetPort: 9106
    - name: YCdata4
      protocol: TCP
      port: 9107
      targetPort: 9107

4.servicemonitor 改成你喜欢的名字

 endpoints:
    - interval: 15s
      port: YCdata1
      relabelings:
        - targetLabel: instance
          replacement: YCdata1
    - interval: 15s
      port: YCdata2
      relabelings:
        - targetLabel: instance
          replacement: YCdata2
    - interval: 15s
      port: YCdata3
      relabelings:
        - targetLabel: instance
          replacement: YCdata3
  endpoints:
   - interval: 15s
     port: YCdata1
     relabelings:
       - targetLabel: instance
         replacement: YCdata1
   - interval: 15s
     port: YCdata2
     relabelings:
       - targetLabel: instance
         replacement: YCdata2
   - interval: 15s
     port: YCdata3
     relabelings:
       - targetLabel: instance
         replacement: YCdata3
   - interval: 15s
     port: YCdata4
     relabelings:
       - targetLabel: instance
         replacement: YCdata4      

done.


<<:  k8s prometheus 监控多个MySql

>>:  伸缩自如的Flask [day 27] Supervisor

[Day-10] R语言 - kernel K - means 实作 ( kernel K - means in R.Studio)

您的订阅是我制作影片的动力 订阅点这里~ 影片程序码 library(naniar) data(ir...

[DAY 1]前言

我主要身分是软件工程师,参赛ARM主题纯粹是兴趣,毕竟隔行如隔山,软件、韧体、硬体差异太大。希望在这...

[Day25] Vue 3 - 认识框架

铁人赛剩最後6天,回顾前面装了这麽多工具和指令,还欠缺实际的应用,手上还有一本 Kuro大的『008...

[Day 15] Reverse 小忙碌

今天我过得很充实, 前几天有看到读者的留言 很感激你们愿意花时间看我的文章 看我分享我每日小生活 为...

Day-15 RAID

RAID tags: IT铁人 这个硬碟有多棒 在评断一个硬碟有多高的Availability时,我...