prometheus监控rocketmq

prometheus监控rocketmq,rocketmq-exporter容器镜像可以参考https://github.com/apache/rocketmq-exporter,yaml部署文件

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rocketmq-exporter
  namespace: rocketmq
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rocketmq-exporter
  template:
    metadata:
      labels:
        app: rocketmq-exporter
    spec:
      hostNetwork: true
      containers:
      - name: rocketmq-exporter
        image: opcache/rabbitmq:rocketmq-exporter
        ports:
        - containerPort: 5557
      nodeSelector:
        type3: test3-node
---
apiVersion: v1
kind: Service
metadata:
  name: rocketmq-exporter
  namespace: rocketmq
spec:
  selector:
    app: rocketmq-exporter
  type: NodePort
  ports:
    -
      name: http
      port: 5557
      targetPort: 5557
      protocol: TCP
      nodePort: 45557

kube-prometheus 添加 prometheus-servicemonitor


cat prometheus-serviceMonitorrocketmq.yaml 
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: exporter-rocketmq
  namespace: monitoring
  labels:
    app: exporter-rocketmq
spec:
  jobLabel: exporter-rocketmq
  endpoints:
  - port: port
    interval: 30s
    scheme: http
  selector:
    matchLabels:
      app: exporter-rocketmq
  namespaceSelector:
    matchNames:
    - kube-system

 
kube-prometheus 添加 rocketmsq  service和 endpoint ,把rocketmq服务导入到集群
cat rocketmq-service-endpoint.yaml 
apiVersion: v1
kind: Endpoints
metadata:
  name: exporter-rocketmq
  namespace: kube-system
  labels:
    app: exporter-rocketmq
subsets:
- addresses:
  - ip: 172.16.231.112
  ports:
  - name: port
    port: 5557
    protocol: TCP

---
apiVersion: v1
kind: Service
metadata:
  name: exporter-rocketmq
  namespace: kube-system
  labels:
    app: exporter-rocketmq
spec:
  type: ClusterIP
  clusterIP: None
  ports:
  - name: port
    port: 5557
    protocol: TCP

Grafana Dashboard的模板文件参考 https://grafana.com/grafana/dashboards/10477
完成!

给TA买糖
共{{data.count}}人
人已赞赏
安装脚本

Centos8下rpm包安装mysql-5.7.31

2021-5-21 16:20:52

网络应用

tcpdump命令

2018-4-24 15:51:42

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
搜索