下载自己解压好
https://github.com/prometheus/mysqld_exporter/releases/download/v0.15.1/mysqld_exporter-0.15.1.linux-amd64.tar.gz
在需要监控的数据库上执行
CREATE USER 'monit_test'@'*' IDENT服务器托管网IFIED BY 'Sfn4ZCHsK' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'monit_test'@'%';
FLUSH PRIVILEGES;
# cat >my.cnfEOF
[client]
user=monit_test
password=Sfn4
host=im-rds-instance.ccom
prot=3306
EOF
cat >DockerfileEOF
FROM alpine:latest
WORKDIR /app
RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main" > /etc/apk/repositories &&
echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/community" >> /etc/apk/repositories &&
apk update &&
apk add tzdata bash-doc bash &&
mkdir /lib64 &&
ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
RUN mkdir /config/
COPY my.cnf /config/my.cnf
COPY mysqld_exporter /app/mysqld_exporter
ENTRYPOINT ["/app/mysqld_exporter", "--config.my-cnf=/config/my.cnf"]
EOF
cat >mysql-monit.yamlEOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysqld-exporter
spec:
replicas: 1
selector:
matchLabels:
app: mysqld-exporter
template:
metadata:
labels:
app: mysqld-exporter
spec:
containers:
- name: mysqld-exporter
image: mysqld:v01
ports:
- containerPort: 9104
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "4000m"
memory: "4096Mi"
---
apiVersion: v1
kind: Service
metadata:
name: mysqld-exporter
spec:
selector:
app:服务器托管网 mysqld-exporter
ports:
- protocol: TCP
name: web
port: 9104
targetPort: 9104
EOF
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
相关推荐: 学习笔记-接口测试(postman、jmeter)
一、什么是接口测试 通常做的接口测试指的是系统对外的接口,比如你需要从别的系统来获取到或者同步资源与信息,他们会提供给你一个写好的接口方法供你调用,比如常用的app,用户同步这些在处理数据的时候需要通过接口进行调用。 webService接口和http api…