【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.