您的位置:首页 > 游戏 > 游戏 > c2c模式的诞生与发展_sf999传奇网站官网_百度站长工具综合查询_北京百度搜索优化

c2c模式的诞生与发展_sf999传奇网站官网_百度站长工具综合查询_北京百度搜索优化

2025/5/3 5:45:41 来源:https://blog.csdn.net/qq_32789063/article/details/147305221  浏览:    关键词:c2c模式的诞生与发展_sf999传奇网站官网_百度站长工具综合查询_北京百度搜索优化
c2c模式的诞生与发展_sf999传奇网站官网_百度站长工具综合查询_北京百度搜索优化

使用 Helm 在 Kubernetes 中安装 MySQL 8.0.37 是一个相对简单的过程。以下是详细步骤:

下载helm包

#添加 Helm 仓库
helm repo add bitnami https://charts.bitnami.com/bitnami#搜索mysql
helm search repo mysql --versions
NAME                         CHART VERSION   APP VERSION     DESCRIPTION
bitnami/mysql                9.12.5          8.0.37          MySQL is a fast, reliable, scalable, and easy t...#下载mysql 
helm pull bitnami/mysql --version=9.12.5#解压下载的helm包
tar -zxvf mysql-9.12.5.tgzcd mysql
vi values.yaml

编写values.yaml

1.storageClass修改
设置pvc的size的大小

global:imageRegistry: ""imagePullSecrets: []storageClass: "xxxx"

2.image.architecture
standalone : 单机
replication : 集群

architecture: standalone

3.auth
设置用户名密码

auth:rootPassword: "your_root_password"createDatabase: truedatabase: "test"username: "test"password: "your_password"replicationUser: replicatorreplicationPassword: ""existingSecret: ""usePasswordFiles: falsecustomPasswordFiles: {}

4.secondary
image.architecture 为 replication,则生效。
secondary.replicaCount 为备机个数

5.my.cnf配置添加

default_authentication_plugin=caching_sha2_password
lower_case_table_names=1
max_connections=10000

6.resources资源配置
limits & requests

7.metrics
enabled: true

8.监控规则

  prometheusRule:enabled: truenamespace: ""additionalLabels: {}rules:- alert: Mysql-Downexpr: absent(up{job="mysql"} == 1)for: 5mlabels:severity: warningservice: mariadbannotations:message: 'MariaDB instance {{`{{`}} $labels.instance {{`}}`}}  is down'summary: MariaDB instance is down

安装 MySQL:

helm install <your-release> -f values.yaml .

检查安装后状态

kubectl get pods -l app.kubernetes.io/name: <your-release>
kubectl get secret <your-release>-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode
mysql -h <your-release>-mysql -u root -p

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com