{"id":69226,"date":"2026-01-31T09:08:52","date_gmt":"2026-01-31T01:08:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/69226.html"},"modified":"2026-01-31T09:08:52","modified_gmt":"2026-01-31T01:08:52","slug":"mysql-operator-for-kubernetes%e8%87%aa%e5%8a%a8%e5%ae%9e%e7%8e%b0%e6%95%b4%e4%b8%aa%e7%94%9f%e5%91%bd%e5%91%a8%e6%9c%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/69226.html","title":{"rendered":"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f"},"content":{"rendered":"<p>\u5b98\u7f51\u5730\u5740&#xff1a;MySQL :: MySQL Operator for Kubernetes Manual<\/p>\n<p>\u5f00\u6e90\u5730\u5740&#xff1a;mysql\/mysql-operator: MySQL Operator for Kubernetes<\/p>\n<h2>\u4e00\u3001\u5f15\u8a00\u4e0e\u4ecb\u7ecd<\/h2>\n<p>MySQL Operator for Kubernetes \u662f Kubernetes \u751f\u6001\u4e2d\u4e13\u4e3a MySQL \u8bbe\u8ba1\u7684\u4e13\u5c5e\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u6838\u5fc3\u57fa\u4e8eCRD&#xff08;\u81ea\u5b9a\u4e49\u8d44\u6e90&#xff09; \u5b9e\u73b0&#xff0c;\u65e8\u5728\u5f7b\u5e95\u7b80\u5316 MySQL InnoDB Cluster \u7684\u90e8\u7f72\u3001\u8fd0\u7ef4\u4e0e\u6269\u5c55&#xff0c;\u5176\u6838\u5fc3\u903b\u8f91\u4e0e\u7ec4\u4ef6\u4ef7\u503c\u53ef\u901a\u8fc7\u4e09\u5c42\u6e05\u6670\u62c6\u89e3&#xff1a;<\/p>\n<h3 id=\"1.%20%E5%9F%BA%E7%A1%80%E6%A0%B8%E5%BF%83\">1. \u57fa\u7840\u6838\u5fc3<\/h3>\n<p>\u6574\u4e2a\u65b9\u6848\u7684\u8fd0\u4f5c\u8d77\u70b9\u662f Kubernetes \u7684 CRD \u6269\u5c55 \u2014\u2014InnoDBCluster \u4f5c\u4e3a\u81ea\u5b9a\u4e49\u8d44\u6e90&#xff0c;\u4e3a MySQL \u96c6\u7fa4\u63d0\u4f9b\u4e86\u6807\u51c6\u5316\u7684\u914d\u7f6e\u5165\u53e3\u3002\u7528\u6237\u53ea\u9700\u5b9a\u4e49InnoDBCluster\u8d44\u6e90\u7684 yaml \u6e05\u5355&#xff08;\u6307\u5b9a\u5b9e\u4f8b\u6570\u91cf\u3001\u914d\u7f6e\u53c2\u6570\u7b49&#xff09;&#xff0c;\u63d0\u4ea4\u81f3 K8s \u96c6\u7fa4\u540e&#xff0c;\u4fbf\u4f1a\u6210\u4e3a Operator \u7684 \u201c\u64cd\u4f5c\u6307\u4ee4\u201d&#xff0c;\u6240\u6709\u540e\u7eed\u7684\u96c6\u7fa4\u642d\u5efa\u3001\u7ef4\u62a4\u52a8\u4f5c&#xff0c;\u5747\u7531 Operator \u57fa\u4e8e\u8be5 CRD \u8d44\u6e90\u7684\u72b6\u6001\u89e6\u53d1&#xff0c;\u8fd9\u662f\u5b9e\u73b0\u96c6\u7fa4\u81ea\u52a8\u5316\u7ba1\u7406\u7684\u6838\u5fc3\u57fa\u7840\u3002<\/p>\n<h3 id=\"2.%20%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6\">2. \u6838\u5fc3\u7ec4\u4ef6<\/h3>\n<h4 id=\"%EF%BC%881%EF%BC%89MySQL%20Operator%EF%BC%9A%E9%9B%86%E7%BE%A4%E7%9A%84%20%E2%80%9C%E8%87%AA%E5%8A%A8%E5%8C%96%E7%AE%A1%E5%AE%B6%E2%80%9D\">&#xff08;1&#xff09;MySQL Operator&#xff1a;\u96c6\u7fa4\u7684 \u201c\u81ea\u52a8\u5316\u7ba1\u5bb6\u201d<\/h4>\n<p>\u4f5c\u4e3a\u65b9\u6848\u7684\u6838\u5fc3\u6267\u884c\u8005&#xff0c;Operator \u8fd0\u884c\u4e8e K8s \u96c6\u7fa4\u7684mysql-operator\u547d\u540d\u7a7a\u95f4&#xff08;\u9ed8\u8ba4&#xff09;&#xff0c;\u901a\u8fc7 Kubernetes Deployment \u4fdd\u969c\u81ea\u8eab\u9ad8\u53ef\u7528\u3002\u5176\u6838\u5fc3\u4f5c\u7528\u662f\u6301\u7eed\u76d1\u542cInnoDBCluster\u81ea\u5b9a\u4e49\u8d44\u6e90\u7684\u72b6\u6001\u53d8\u5316&#xff1a;\u4e00\u65e6\u68c0\u6d4b\u5230\u8d44\u6e90\u521b\u5efa\u3001\u66f4\u65b0\u6216\u5f02\u5e38&#xff0c;\u4fbf\u81ea\u52a8\u89e6\u53d1\u4e00\u7cfb\u5217\u8fd0\u7ef4\u64cd\u4f5c \u2014\u2014 \u5305\u62ec\u521b\u5efa\u7ba1\u7406 MySQL \u670d\u52a1\u5668\u7684 StatefulSet&#xff08;\u7ed1\u5b9a\u5b58\u50a8\u5377\u3001\u914d\u7f6e\u5bb9\u5668\u7ec4&#xff09;\u3001\u90e8\u7f72 MySQL Router\u3001\u751f\u6210 ConfigMap&#xff08;MySQL \u914d\u7f6e&#xff09;\u4e0e Secret&#xff08;\u8ba4\u8bc1\u51ed\u8bc1&#xff09;&#xff0c;\u540c\u65f6\u81ea\u52a8\u914d\u7f6e MySQL Group Replication \u5b9e\u73b0\u6570\u636e\u540c\u6b65&#xff0c;\u5168\u7a0b\u65e0\u9700\u4eba\u5de5\u4ecb\u5165\u590d\u6742\u914d\u7f6e\u3002<\/p>\n<h4 id=\"%EF%BC%882%EF%BC%89InnoDB%20Cluster%EF%BC%9A%E6%95%B0%E6%8D%AE%E5%BA%93%E9%9B%86%E7%BE%A4%E7%9A%84%20%E2%80%9C%E6%A0%B8%E5%BF%83%E5%AE%9E%E4%BD%93%E2%80%9D\">&#xff08;2&#xff09;InnoDB Cluster&#xff1a;\u6570\u636e\u5e93\u96c6\u7fa4\u7684 \u201c\u6838\u5fc3\u5b9e\u4f53\u201d<\/h4>\n<p>InnoDBCluster\u4e0d\u4ec5\u662f CRD \u8d44\u6e90\u540d\u79f0&#xff0c;\u66f4\u662f\u5b9e\u9645\u8fd0\u884c\u7684 MySQL \u6570\u636e\u5e93\u96c6\u7fa4\u6838\u5fc3 \u2014\u2014 \u7531\u4e00\u7ec4 MySQL \u670d\u52a1\u5668&#xff08;Primary\/Secondary \u8282\u70b9&#xff09;\u7ec4\u6210&#xff0c;\u901a\u8fc7 Operator \u914d\u7f6e\u7684 Group Replication \u5b9e\u73b0\u6570\u636e\u5b9e\u65f6\u540c\u6b65&#xff0c;\u5929\u7136\u5177\u5907\u9ad8\u53ef\u7528\u7279\u6027\u3002\u5b83\u662f\u5b58\u50a8\u6570\u636e\u3001\u5904\u7406\u4e1a\u52a1\u8bf7\u6c42\u7684\u6838\u5fc3\u8f7d\u4f53&#xff0c;Operator \u901a\u8fc7\u7ef4\u62a4\u5176\u8282\u70b9\u72b6\u6001\u3001\u590d\u5236\u94fe\u8def&#xff0c;\u786e\u4fdd\u96c6\u7fa4\u7a33\u5b9a\u8fd0\u884c&#xff0c;\u907f\u514d\u5355\u70b9\u6545\u969c\u3002<\/p>\n<h4 id=\"%EF%BC%883%EF%BC%89MySQL%20Router%EF%BC%9A%E5%BA%94%E7%94%A8%E4%B8%8E%E9%9B%86%E7%BE%A4%E7%9A%84%20%E2%80%9C%E6%99%BA%E8%83%BD%E7%BD%91%E5%85%B3%E2%80%9D\">&#xff08;3&#xff09;MySQL Router&#xff1a;\u5e94\u7528\u4e0e\u96c6\u7fa4\u7684 \u201c\u667a\u80fd\u7f51\u5173\u201d<\/h4>\n<p>MySQL Router \u662f Operator \u81ea\u52a8\u90e8\u7f72\u7684\u65e0\u72b6\u6001\u8def\u7531\u7ec4\u4ef6&#xff08;\u901a\u8fc7 K8s Deployment \u7ba1\u7406&#xff0c;\u652f\u6301\u5f39\u6027\u6269\u7f29\u5bb9&#xff09;\u3002\u5176\u6838\u5fc3\u4f5c\u7528\u662f\u4f5c\u4e3a\u5e94\u7528\u4e0e InnoDB Cluster \u4e4b\u95f4\u7684\u4e2d\u95f4\u5c42&#xff1a;\u4e00\u65b9\u9762\u4e3a\u5e94\u7528\u63d0\u4f9b\u7a33\u5b9a\u7684\u8bbf\u95ee\u5165\u53e3&#xff08;\u901a\u8fc7 K8s Service \u66b4\u9732&#xff09;&#xff0c;\u5c4f\u853d\u96c6\u7fa4\u8282\u70b9\u62d3\u6251\u53d8\u5316&#xff1b;\u53e6\u4e00\u65b9\u9762\u6839\u636e\u5e94\u7528\u9700\u6c42\u667a\u80fd\u8def\u7531\u8bf7\u6c42 \u2014\u2014 \u5c06\u5199\u8bf7\u6c42\u8f6c\u53d1\u81f3 Primary \u8282\u70b9&#xff0c;\u8bfb\u8bf7\u6c42\u5206\u53d1\u81f3 Secondary \u8282\u70b9&#xff0c;\u65e2\u7b80\u5316\u4e86\u5e94\u7528\u8fde\u63a5\u914d\u7f6e&#xff0c;\u53c8\u5b9e\u73b0\u4e86\u8bfb\u5199\u5206\u79bb\u4e0e\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n<h3 id=\"3.%20%E6%A0%B8%E5%BF%83%E4%BB%B7%E5%80%BC\">3. \u6838\u5fc3\u4ef7\u503c<\/h3>\n<p>\u501f\u52a9 CRD \u7684\u6807\u51c6\u5316\u914d\u7f6e\u4e0e Operator \u7684\u81ea\u52a8\u5316\u7ba1\u7406&#xff0c;\u5f00\u53d1\u8005\u65e0\u9700\u6df1\u5165 MySQL \u5e95\u5c42\u8fd0\u7ef4\u7ec6\u8282&#xff0c;\u4ec5\u901a\u8fc7\u5b9a\u4e49InnoDBCluster\u8d44\u6e90\u5373\u53ef\u5feb\u901f\u642d\u5efa\u9ad8\u53ef\u7528 MySQL \u96c6\u7fa4&#xff1b;\u800c MySQL Router \u7684\u8def\u7531\u80fd\u529b\u4e0e InnoDB Cluster \u7684\u590d\u5236\u673a\u5236&#xff0c;\u65e2\u786e\u4fdd\u4e86\u5e94\u7528\u8bbf\u95ee\u7684\u7a33\u5b9a\u6027&#xff08;\u65e0\u9700\u5173\u5fc3\u8282\u70b9\u5207\u6362&#xff09;&#xff0c;\u53c8\u652f\u6301\u6839\u636e\u4e1a\u52a1\u8d1f\u8f7d\u5f39\u6027\u6269\u5c55&#xff0c;\u5b8c\u7f8e\u9002\u914d Kubernetes \u7684\u5bb9\u5668\u5316\u3001\u4e91\u539f\u751f\u573a\u666f\u3002<\/p>\n<p>Kubernetes\u7684MySQL\u4f5c\u7b26\u67b6\u6784\u56fe<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"884\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010849-697d5621199b9.png\" width=\"916\" \/><\/p>\n<p>\u672c\u6587\u91c7\u7528\u5b8c\u5168\u8d44\u6e90\u6e05\u5355\u7684\u65b9\u5f0f\u53bb\u90e8\u7f72&#xff0c;\u56e0\u4e3aHelm\u6211\u6ca1\u770b\u5230\u5b98\u65b9\u7684\u4e00\u4e2a\u5b9a\u4e49&#xff0c;\u627e\u4e0d\u5230\u6807\u51c6\u7684\u8d44\u6e90\u955c\u50cf&#xff0c;\u7136\u540e\u6211\u5c31\u61d2\u5f97\u53bbinstall Chart\u5305\u53bb\u4fee\u6539values\u4e0b\u9762\u7684\u955c\u50cftag\u4e86&#xff0c;\u7d22\u6027\u76f4\u63a5\u4f7f\u7528\u8d44\u6e90\u6e05\u5355\u90e8\u7f72\u4e86\u3002<\/p>\n<p>\u5c31\u6bd4\u5982\u6211\u8981\u90e8\u7f728.4.8-2.1.10\u7248\u672c\u7684Chart&#xff0c;\u7136\u540e\u6211\u8981\u53bb\u63d0\u524d\u62c9\u53d6\u955c\u50cf\u561b\u3002&#xff08;\u56e0\u4e3a\u6211\u7b2c\u4e00\u6b21\u4e5f\u662f\u76f4\u63a5helm install \u4f46\u662f\u53d1\u73b0\u62c9\u53d6\u7684\u955c\u50cf\u662f8.4.8&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"380\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010849-697d56216cdca.png\" width=\"2419\" \/><\/p>\n<p>\u6211\u5c31\u767b\u5f55\u5230\u4e86Oracle Container Registry\u4ed3\u5e93&#xff0c;\u4f46\u662f\u6ca1\u6709\u627e\u52308.4.8-2.1.10\u7684\u955c\u50cf&#xff0c;\u7136\u540e\u6211\u8fd8\u6ca1\u6709\u627e\u5230\u5b98\u65b9\u7684Helm\u7684\u5b9a\u4e49&#xff0c;\u6211\u5c31\u6ca1\u6709\u4e0b\u8f7d8.4.8\u7684chart\u7136\u540e\u4fee\u6539\u955c\u50cf\u4e3a8.4.7&#xff0c;\u6211\u6015CRD\u5230\u65f6\u5019\u4f1a\u6709\u4e0d\u517c\u5bb9\u4e4b\u7c7b\u7684\u60c5\u51b5&#xff0c;\u6240\u4ee5\u8fd9\u91cc\u5c31\u76f4\u63a5\u4f7f\u75288.4.7\u53bb\u90e8\u7f72\u4e86\u4e00\u5957\u81ea\u52a8\u5316\u67b6\u6784\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1040\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010849-697d5621dab18.png\" width=\"1591\" \/><\/p>\n<p>\u96be\u9053\u5728\u4e0d\u540c\u7684\u4ed3\u5e93&#xff1f;\u672c\u4eba\u6ca1\u7814\u7a76\u8fd9\u4e2a\u67b6\u6784\u592a\u957f\u65f6\u95f4&#xff0c;\u6709\u61c2\u5f97\u53ef\u4ee5\u89e3\u91ca\u4e00\u4e0b\u3002<\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81%20%E6%9E%B6%E6%9E%84%E7%9A%84%E5%AE%9E%E7%8E%B0\">\u4e8c\u3001 \u67b6\u6784\u7684\u5b9e\u73b0<\/h2>\n<p>\u672c\u6587\u91c7\u7528\u7684\u6240\u6709\u8d44\u6e90\u6807\u51c6\u5747\u4e3a\u81ea\u5df1\u7684\u5b9e\u9a8c\u73af\u5883&#xff0c;\u8bf7\u751f\u6210\u73af\u5883\u81ea\u52a9\u8c03\u6574\u8d44\u6e90\u914d\u7f6e\u5927\u5c0f\u3002<\/p>\n<\/p>\n<p>\u8d44\u6e90\u6e05\u5355\u65b9\u5f0f\u5b89\u88c58.4.7mysql-operator\/deploy at 8.4.7-2.1.9 \u00b7 mysql\/mysql-operator<\/p>\n<h3 id=\"2.1.%20%E5%AE%89%E8%A3%85Operator%E4%B8%8ECRD%E8%B5%84%E6%BA%90\">2.1. \u5b89\u88c5Operator\u4e0eCRD\u8d44\u6e90<\/h3>\n<p>[root&#064;k8s-master ~\/mysql-operator]# kubectl apply -f https:\/\/github.com\/mysql\/mysql-operator\/blob\/8.4.7-2.1.9\/deploy\/deploy-crds.yaml<br \/>\n[root&#064;k8s-master ~\/mysql-operator]# kubectl apply -f https:\/\/github.com\/mysql\/mysql-operator\/blob\/8.4.7-2.1.9\/deploy\/deploy-operator.yaml<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator]# kubectl -n mysql-operator get all -o wide<br \/>\nNAME                                  READY   STATUS    RESTARTS   AGE   IP             NODE        NOMINATED NODE   READINESS GATES<br \/>\npod\/mysql-operator-6c49944b64-fmbwq   1\/1     Running   0          18s   10.200.36.75   k8s-node1   &lt;none&gt;           &lt;none&gt;<\/p>\n<p>NAME                             READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS       IMAGES                                                               SELECTOR<br \/>\ndeployment.apps\/mysql-operator   1\/1     1            1           18s   mysql-operator   container-registry.oracle.com\/mysql\/community-operator:8.4.7-2.1.9   name&#061;mysql-operator<\/p>\n<p>NAME                                        DESIRED   CURRENT   READY   AGE   CONTAINERS       IMAGES                                                               SELECTOR<br \/>\nreplicaset.apps\/mysql-operator-6c49944b64   1         1         1       18s   mysql-operator   container-registry.oracle.com\/mysql\/community-operator:8.4.7-2.1.9   name&#061;mysql-operator,pod-template-hash&#061;6c49944b64 <\/p>\n<h3 id=\"%E5%BD%A9%E8%9B%8B%EF%BC%9A%E9%95%9C%E5%83%8F%E6%8B%89%E5%8F%96%E6%96%B9%E6%B3%95\">\u5f69\u86cb&#xff1a;\u955c\u50cf\u62c9\u53d6\u65b9\u6cd5<\/h3>\n<p>\u767b\u5f55Oracle Container Registry&#xff1a;Oracle Container Registry<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"532\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010850-697d562296ffb.png\" width=\"955\" \/><\/p>\n<p>\u767b\u5f55\u5b8c\u6210\u70b9\u51fb\u53f3\u4e0a\u89d2Auth Token\u53bb\u65b0\u5efaToken<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"530\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010850-697d5622d61b9.png\" width=\"955\" \/><\/p>\n<p>\u7136\u540e\u5c06\u81ea\u5df1\u751f\u6210\u7684Token\u590d\u5236\u4fdd\u5b58\u4e0b\u6765\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"486\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010851-697d562321eb9.png\" width=\"958\" \/><\/p>\n<p>\u8bb0\u4f4f\u62f7\u8d1d\u81ea\u5df1\u7684Secret<\/p>\n<p>ehaR9Dqba1cbkYxcMpfJ <\/p>\n<p>docker\u767b\u5f55\u955c\u50cf\u4ed3\u5e93<\/p>\n<p>[root&#064;k8s-master ~]# docker login container-registry.oracle.com<br \/>\nUsername: 914XXXXX&#064;qq.com<br \/>\nPassword: # \u8f93\u5165\u81ea\u5df1\u751f\u6210\u7684Secret\u4f5c\u4e3a\u5bc6\u7801<\/p>\n<p>WARNING! Your credentials are stored unencrypted in &#039;\/root\/.docker\/config.json&#039;.<br \/>\nConfigure a credential helper to remove this warning. See<br \/>\nhttps:\/\/docs.docker.com\/go\/credential-store\/<\/p>\n<p>Login Succeeded<\/p>\n<p># \u62c9\u53d6\u955c\u50cf\u5373\u53ef&#xff0c;\u6ce8\u610fK8S\u96c6\u7fa4\u6700\u597d\u90fd\u5b58\u5728\u6b64\u955c\u50cf\u3002<br \/>\n[root&#064;k8s-master ~]# docker pull container-registry.oracle.com\/mysql\/community-operator:8.4.7-2.1.9<br \/>\n8.4.7-2.1.9: Pulling from mysql\/community-operator<br \/>\n034ed5741540: Pull complete<br \/>\n8850e9060076: Pull complete<br \/>\n72a19e97697b: Pull complete<br \/>\ncb8069ff2565: Pull complete<br \/>\n20b9802feff4: Pull complete<br \/>\n3290b0b94ed1: Pull complete<br \/>\ncea3ba72d0c2: Pull complete<br \/>\nDigest: sha256:f04a98bba815c33f649a802a1669f85ebe5ead4dcb54264babd8749b70b056f2<br \/>\nStatus: Downloaded newer image for container-registry.oracle.com\/mysql\/community-operator:8.4.7-2.1.9<br \/>\ncontainer-registry.oracle.com\/mysql\/community-operator:8.4.7-2.1.9<br \/>\n[root&#064;k8s-master ~]# docker pull container-registry.oracle.com\/mysql\/community-router:8.4.7<br \/>\n8.4.7: Pulling from mysql\/community-router<br \/>\n63ce17d7402e: Pull complete<br \/>\nc1796c1f2872: Pull complete<br \/>\nb54c084a1ded: Pull complete<br \/>\nDigest: sha256:b1d63a7ee895db71d9c763085192a378958d2cc5bf3ec6a2a1feb9f21652d9ba<br \/>\nStatus: Downloaded newer image for container-registry.oracle.com\/mysql\/community-router:8.4.7<br \/>\ncontainer-registry.oracle.com\/mysql\/community-router:8.4.7 <\/p>\n<h3 id=\"2.2.%C2%A0%E9%83%A8%E7%BD%B2InnoDBCluster%2BRouter\">2.2.\u00a0\u90e8\u7f72InnoDBCluster&#043;Router<\/h3>\n<p>\u8981\u7528 kubectl \u521b\u5efa InnoDB \u96c6\u7fa4&#xff0c; \u9996\u5148\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u65b0MySQL\u51ed\u8bc1\u7684\u79d8\u5bc6 root \u7528\u6237&#xff0c;\u4e00\u4e2a\u540d\u4e3a\u201cmy-root-secret\u201d\u7684\u79d8\u5bc6\u793a\u4f8b&#xff1a;<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator]# kubectl create ns mysql-cluster<br \/>\nnamespace\/mysql-cluster created<br \/>\n[root&#064;k8s-master ~\/mysql-operator]# kubectl create secret generic my-root-secret \\\\<br \/>\n  &#8211;from-literal&#061;rootUser&#061;root \\\\<br \/>\n  &#8211;from-literal&#061;rootHost&#061;% \\\\<br \/>\n  &#8211;from-literal&#061;rootPassword&#061;&#039;String&#064;1307!&#039; \\\\<br \/>\n  &#8211;namespace mysql-cluster<br \/>\nsecret\/my-root-secret created <\/p>\n<p>\u7528\u65b0\u521b\u5efa\u7684\u7528\u6237\u914d\u7f6e\u65b0\u7684MySQL InnoDB\u96c6\u7fa4\u3002\u8fd9\u4e2a\u4f8b\u5b50\u662fInnoDBCluster\u5b9a\u4e49 \u521b\u5efa\u4e09\u4e2a MySQL \u670d\u52a1\u5668\u5b9e\u4f8b\u548c\u4e24\u4e2a MySQL \u8def\u7531\u5668\u5b9e\u4f8b&#xff1a;<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# cat mysql-innodb-cluster.yaml<br \/>\napiVersion: mysql.oracle.com\/v2<br \/>\nkind: InnoDBCluster<br \/>\nmetadata:<br \/>\n  name: my-cluster<br \/>\n  namespace: mysql-cluster<br \/>\nspec:<br \/>\n  version: &#034;8.4.7&#034;<br \/>\n  instances: 3<br \/>\n  secretName: my-root-secret<br \/>\n  edition: community<br \/>\n  tlsUseSelfSigned: true<\/p>\n<p>  # &#8212; 1. \u5907\u4efd\u7b56\u7565\u914d\u7f6e (\u5173\u952e\u4fee\u590d\u70b9) &#8212;<br \/>\n  backupProfiles:<br \/>\n    &#8211; name: nfs-profile<br \/>\n      dumpInstance:<br \/>\n        storage:<br \/>\n          # \u5fc5\u987b\u4f7f\u7528\u5168\u79f0<br \/>\n          persistentVolumeClaim:<br \/>\n            claimName: mysql-backup-pvc<\/p>\n<p>  # &#8212; 2. \u6570\u636e\u5e93\u53c2\u6570\u4f18\u5316 (\u9488\u5bf9 4G \u5185\u5b58\u73af\u5883) &#8212;<br \/>\n  mycnf: |<br \/>\n    [mysqld]<br \/>\n    # \u9650\u5236\u5185\u5b58\u6c60\u4e3a 512M&#xff0c;\u7ed9\u7cfb\u7edf\u7559\u4f59\u5730<br \/>\n    innodb_buffer_pool_size&#061;512M<br \/>\n    # \u5f00\u542f\u6027\u80fd\u76d1\u63a7\u4ee5\u652f\u6301 InnoDB \u96c6\u7fa4<br \/>\n    performance_schema&#061;ON<br \/>\n    max_connections&#061;150<br \/>\n    innodb_log_file_size&#061;128M<br \/>\n    binlog_expire_logs_seconds&#061;604800<br \/>\n    # \u51cf\u5c11\u6587\u4ef6\u7cfb\u7edf\u7f13\u5b58\u538b\u529b<br \/>\n    innodb_flush_method&#061;O_DIRECT<\/p>\n<p>  # &#8212; 3. \u8d44\u6e90\u914d\u989d (QoS) &#8212;<br \/>\n  podSpec:<br \/>\n    resources:<br \/>\n      limits:<br \/>\n        cpu: &#034;500m&#034;<br \/>\n        memory: &#034;1.5Gi&#034;<br \/>\n      requests:<br \/>\n        cpu: &#034;100m&#034;<br \/>\n        memory: &#034;512Mi&#034;<\/p>\n<p>  # &#8212; 4. \u6570\u636e\u5b58\u50a8\u914d\u7f6e &#8212;<br \/>\n  datadirVolumeClaimTemplate:<br \/>\n    storageClassName: &#034;nfs-csi&#034;<br \/>\n    accessModes:<br \/>\n      &#8211; ReadWriteOnce<br \/>\n    resources:<br \/>\n      requests:<br \/>\n        storage: 10Gi<\/p>\n<p>  # &#8212; 5. \u8bfb\u5199\u5206\u79bb Router \u914d\u7f6e &#8212;<br \/>\n  router:<br \/>\n    instances: 2<br \/>\n    podSpec:<br \/>\n      # \u5f3a\u5236\u8c03\u5ea6\u5230\u6253\u8fc7\u6807\u7b7e\u7684\u8282\u70b9<br \/>\n      nodeSelector:<br \/>\n        mysql-router: &#034;true&#034;<br \/>\n      containers:<br \/>\n      &#8211; name: router<br \/>\n        image: container-registry.oracle.com\/mysql\/community-router:8.4.7<br \/>\n        imagePullPolicy: IfNotPresent<br \/>\n        resources:<br \/>\n          requests:<br \/>\n            cpu: &#034;100m&#034;<br \/>\n            memory: &#034;128Mi&#034;<br \/>\n          limits:<br \/>\n            cpu: &#034;200m&#034;<br \/>\n            memory: &#034;256Mi&#034; <\/p>\n<p>\u5728\u628a\u5907\u4efd\u8981\u7528\u5230\u4e86PV\u7ed9\u521b\u5efa\u51fa\u6765<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# cat mysql-backup-pvc.yaml<br \/>\napiVersion: v1<br \/>\nkind: PersistentVolumeClaim<br \/>\nmetadata:<br \/>\n  name: mysql-backup-pvc<br \/>\n  namespace: mysql-cluster<br \/>\nspec:<br \/>\n  # \u786e\u4fdd\u8fd9\u91cc\u7528\u7684\u662f\u4f60\u96c6\u7fa4\u91cc\u6b63\u786e\u7684 NFS StorageClass \u540d\u5b57<br \/>\n  storageClassName: &#034;nfs-csi&#034;<br \/>\n  accessModes:<br \/>\n    &#8211; ReadWriteMany  # \u63a8\u8350&#xff1a;NFS \u4e00\u822c\u652f\u6301\u591a\u8bfb\u5199&#xff0c;\u65b9\u4fbf\u67e5\u770b<br \/>\n  resources:<br \/>\n    requests:<br \/>\n      storage: 10Gi <\/p>\n<p>\u7136\u540e\u5c06\u8d44\u6e90\u7ed9\u521b\u5efa\u51fa\u6765<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl apply -f mysql-backup-pvc.yaml<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl get -f mysql-backup-pvc.yaml<br \/>\nNAME               STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE<br \/>\nmysql-backup-pvc   Bound    pvc-2c7017a9-75ef-4523-94c9-dfcf6a30b819   10Gi       RWX            nfs-csi        &lt;unset&gt;                 3m37s <\/p>\n<p>\u6ce8\u610f&#xff0c;\u5728\u521b\u5efaInnoDBCluster\u4e4b\u524d&#xff0c;\u8bf7\u5c06\u4e24\u4e2a\u8981\u90e8\u7f72Router\u7684\u8282\u70b9\u6253\u4e0a\u5bf9\u5e94\u7684\u6807\u7b7e&#xff0c;\u6765\u65b9\u4fbf\u5206\u8282\u70b9\u8c03\u5ea6\u3002<\/p>\n<p>[root&#064;k8s-master ~]# kubectl label nodes k8s-node1 mysql-router&#061;true<br \/>\nnode\/k8s-node1 labeled<br \/>\n[root&#064;k8s-master ~]# kubectl label nodes k8s-node2 mysql-router&#061;true<br \/>\nnode\/k8s-node2 labeled<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl apply -f mysql-innodb-cluster.yaml <\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster get po,pv,pvc -o wide<br \/>\nNAME                                    READY   STATUS    RESTARTS   AGE     IP               NODE        NOMINATED NODE   READINESS GATES<br \/>\npod\/my-cluster-0                        2\/2     Running   0          4m37s   10.200.36.82     k8s-node1   &lt;none&gt;           2\/2<br \/>\npod\/my-cluster-1                        2\/2     Running   0          4m37s   10.200.36.81     k8s-node1   &lt;none&gt;           2\/2<br \/>\npod\/my-cluster-2                        2\/2     Running   0          4m37s   10.200.169.167   k8s-node2   &lt;none&gt;           2\/2<br \/>\npod\/my-cluster-router-67fd998b7-6m865   1\/1     Running   0          2m39s   10.200.36.83     k8s-node1   &lt;none&gt;           &lt;none&gt;<br \/>\npod\/my-cluster-router-67fd998b7-xrrx7   1\/1     Running   0          2m39s   10.200.169.168   k8s-node2   &lt;none&gt;           &lt;none&gt;<\/p>\n<p>NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE     VOLUMEMODE<br \/>\npersistentvolume\/pvc-2c7017a9-75ef-4523-94c9-dfcf6a30b819   10Gi       RWX            Delete           Bound    mysql-cluster\/mysql-backup-pvc       nfs-csi        &lt;unset&gt;                          4m50s   Filesystem<br \/>\npersistentvolume\/pvc-4df4cd5a-35c8-40de-a500-922ebfd8dc2d   10Gi       RWO            Delete           Bound    mysql-cluster\/datadir-my-cluster-2   nfs-csi        &lt;unset&gt;                          4m36s   Filesystem<br \/>\npersistentvolume\/pvc-c0d0a765-00bd-4d4c-be94-2f2f79d7acc4   10Gi       RWO            Delete           Bound    mysql-cluster\/datadir-my-cluster-1   nfs-csi        &lt;unset&gt;                          4m36s   Filesystem<br \/>\npersistentvolume\/pvc-e5d7e917-d24e-4835-9798-03de85a6c054   10Gi       RWO            Delete           Bound    mysql-cluster\/datadir-my-cluster-0   nfs-csi        &lt;unset&gt;                          4m37s   Filesystem<\/p>\n<p>NAME                                         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE     VOLUMEMODE<br \/>\npersistentvolumeclaim\/datadir-my-cluster-0   Bound    pvc-e5d7e917-d24e-4835-9798-03de85a6c054   10Gi       RWO            nfs-csi        &lt;unset&gt;                 4m37s   Filesystem<br \/>\npersistentvolumeclaim\/datadir-my-cluster-1   Bound    pvc-c0d0a765-00bd-4d4c-be94-2f2f79d7acc4   10Gi       RWO            nfs-csi        &lt;unset&gt;                 4m37s   Filesystem<br \/>\npersistentvolumeclaim\/datadir-my-cluster-2   Bound    pvc-4df4cd5a-35c8-40de-a500-922ebfd8dc2d   10Gi       RWO            nfs-csi        &lt;unset&gt;                 4m37s   Filesystem<br \/>\npersistentvolumeclaim\/mysql-backup-pvc       Bound    pvc-2c7017a9-75ef-4523-94c9-dfcf6a30b819   10Gi       RWX            nfs-csi        &lt;unset&gt;                 4m50s   Filesystem<\/p>\n<p># \u786e\u4fdd\u4e09\u4e2a\u90fd\u5df2\u7ecf\u5728\u7ebf\u5373\u53ef<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster get innodbclusters.mysql.oracle.com<br \/>\nNAME         STATUS   ONLINE   INSTANCES   ROUTERS   AGE<br \/>\nmy-cluster   ONLINE   3        3           2         4m58s <\/p>\n<p>\u8d44\u6e90\u521b\u5efa\u5b8c\u6210\u4e4b\u540e\u53ef\u4ee5\u67e5\u770b\u5bf9\u5e94\u7684\u6570\u636e\u76ee\u5f55\u662f\u5426\u4ee5\u53ca\u521d\u59cb\u5316\u5230\u4e86\u6570\u636e<\/p>\n<p># \u67e5\u770b\u6570\u636e\u76ee\u5f55<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# cd \/data\/nfs-server\/pvc-4df4cd5a-35c8-40de-a500-922ebfd8dc2d\/<br \/>\n[root&#064;k8s-master \/data\/nfs-server\/pvc-4df4cd5a-35c8-40de-a500-922ebfd8dc2d]# ll<br \/>\ntotal 135792<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo  4194304 Jan 27 10:29 &#039;#ib_16384_0.dblwr&#039;<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 12582912 Jan 27 09:46 &#039;#ib_16384_1.dblwr&#039;<br \/>\ndrwxr-s&#8212; 2 27 sudo     4096 Jan 27 09:47  &#039;#innodb_redo&#039;\/<br \/>\ndrwxr-s&#8212; 2 27 sudo     4096 Jan 27 09:47  &#039;#innodb_temp&#039;\/<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo        0 Jan 27 09:48  GCS_DEBUG_TRACE<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo       56 Jan 27 09:46  auto.cnf<br \/>\n-rw&#8212;&#8212;- 1 27 sudo     1705 Jan 27 09:46  ca-key.pem<br \/>\n-rw-r&#8211;r&#8211; 1 27 sudo     1108 Jan 27 09:46  ca.pem<br \/>\n-rw-r&#8211;r&#8211; 1 27 sudo     1108 Jan 27 09:46  client-cert.pem<br \/>\n-rw&#8212;&#8212;- 1 27 sudo     1705 Jan 27 09:46  client-key.pem<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo     5721 Jan 27 09:47  ib_buffer_pool<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 12582912 Jan 27 10:29  ibdata1<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 12582912 Jan 27 09:47  ibtmp1<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo      236 Jan 27 09:48  my-cluster-2-relay-bin-group_replication_applier.000001<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 15400214 Jan 27 10:29  my-cluster-2-relay-bin-group_replication_applier.000002<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo      116 Jan 27 09:48  my-cluster-2-relay-bin-group_replication_applier.index<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo      158 Jan 27 09:48  my-cluster-2-relay-bin-group_replication_recovery.000001<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo       59 Jan 27 09:48  my-cluster-2-relay-bin-group_replication_recovery.index<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo        2 Jan 27 09:47  my-cluster-2.pid<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo      181 Jan 27 09:46  my-cluster.000001<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo      181 Jan 27 09:47  my-cluster.000002<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 15528012 Jan 27 10:29  my-cluster.000003<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo       60 Jan 27 09:47  my-cluster.index<br \/>\ndrwxr-s&#8212; 2 27 sudo     4096 Jan 27 09:46  mysql\/<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 32505856 Jan 27 10:29  mysql.ibd<br \/>\ndrwxr-s&#8212; 2 27 sudo     4096 Jan 27 09:48  mysql_innodb_cluster_metadata\/<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo      124 Jan 27 09:46  mysql_upgrade_history<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo     1771 Jan 27 09:48  mysqld-auto.cnf<br \/>\ndrwxr-s&#8212; 2 27 sudo     4096 Jan 27 09:48  performance_schema\/<br \/>\n-rw&#8212;&#8212;- 1 27 sudo     1705 Jan 27 09:46  private_key.pem<br \/>\n-rw-r&#8211;r&#8211; 1 27 sudo      452 Jan 27 09:46  public_key.pem<br \/>\n-rw-r&#8211;r&#8211; 1 27 sudo     1108 Jan 27 09:46  server-cert.pem<br \/>\n-rw&#8212;&#8212;- 1 27 sudo     1705 Jan 27 09:46  server-key.pem<br \/>\ndrwxr-s&#8212; 2 27 sudo     4096 Jan 27 09:46  sys\/<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 16777216 Jan 27 10:29  undo_001<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 16777216 Jan 27 10:29  undo_002 <\/p>\n<h3 id=\"2.3%20%E5%B0%86Router%E6%9A%B4%E9%9C%B2%E5%87%BA%E5%8E%BB\">2.3 \u5c06Router\u66b4\u9732\u51fa\u53bb<\/h3>\n<p># \u521b\u5efaRoute\u7684SVC\u7aef\u53e3\u66b4\u9732&#xff0c;\u53ef\u4ee5\u5728\u5916\u90e8\u4f7f\u7528\u56fe\u5f62\u5316\u5de5\u5177\u76f4\u63a5\u8fd0\u7ef4<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# cat mysql-route-svc.yaml<br \/>\napiVersion: v1<br \/>\nkind: Service<br \/>\nmetadata:<br \/>\n  name: my-cluster-router-lb<br \/>\n  namespace: mysql-cluster<br \/>\n  labels:<br \/>\n    app.kubernetes.io\/name: my-cluster-router-lb<br \/>\nspec:<br \/>\n  type: NodePort<br \/>\n  selector:<br \/>\n    app.kubernetes.io\/component: router<br \/>\n    app.kubernetes.io\/name: mysql-router<br \/>\n  ports:<br \/>\n    &#8211; name: mysql-rw<br \/>\n      port: 30306<br \/>\n      targetPort: 6446<br \/>\n      nodePort: 30306  # \u8bfb\u5199\u7aef\u53e3\u66b4\u9732\u7ed9\u5916\u90e8<br \/>\n    &#8211; name: mysql-ro<br \/>\n      port: 30307<br \/>\n      targetPort: 6447<br \/>\n      nodePort: 30307  # \u53ea\u8bfb\u7aef\u53e3\u66b4\u9732\u7ed9\u5916\u90e8<br \/>\n  sessionAffinity: None<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl apply -f mysql-route-svc.yaml<br \/>\nservice\/my-cluster-router-lb created<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster get svc<br \/>\nNAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                    AGE<br \/>\nmy-cluster             ClusterIP   10.110.26.7     &lt;none&gt;        3306\/TCP,33060\/TCP,6446\/TCP,6448\/TCP,6447\/TCP,6449\/TCP,6450\/TCP,8443\/TCP   13m<br \/>\nmy-cluster-instances   ClusterIP   None            &lt;none&gt;        3306\/TCP,33060\/TCP,33061\/TCP                                               13m<br \/>\nmy-cluster-router-lb   NodePort    10.102.39.114   &lt;none&gt;        30306:30306\/TCP,30307:30307\/TCP                                            7s <\/p>\n<p>\u6d4b\u8bd5\u8fde\u63a5<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# telnet 10.0.0.6 30306<br \/>\nTrying 10.0.0.6&#8230;<br \/>\nConnected to 10.0.0.6.<br \/>\nEscape character is &#039;^]&#039;.<br \/>\nP<br \/>\n8.4.7-router~<br \/>\n             b1\u07eenC1Cn,H$o8q~caching_sha2_password^]<br \/>\ntelnet&gt; quit<br \/>\nConnection closed.<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# telnet 10.0.0.6 30307<br \/>\nTrying 10.0.0.6&#8230;<br \/>\nConnected to 10.0.0.6.<br \/>\nEscape character is &#039;^]&#039;.<br \/>\nP<br \/>\n8.4.7-routerAh&#064;#N!W\u07eehPmW0Igu]^4!caching_sha2_password^]<br \/>\ntelnet&gt; quit<br \/>\nConnection closed. <\/p>\n<p>\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Navicat\u8fdb\u884c\u8fde\u63a5<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"765\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010851-697d56235613f.png\" width=\"953\" \/><\/p>\n<h2 id=\"%E4%B8%89%E3%80%81%E5%A4%87%E4%BB%BD%E5%8A%9F%E8%83%BD\">\u4e09\u3001\u5907\u4efd\u529f\u80fd<\/h2>\n<h3 id=\"3.1%20%E9%AA%8C%E8%AF%81%E5%A4%87%E4%BB%BD%EF%BC%88dumpInstance%EF%BC%89\">3.1 \u9a8c\u8bc1\u5907\u4efd&#xff08;dumpInstance&#xff09;<\/h3>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# cat test-backup.yaml<br \/>\napiVersion: mysql.oracle.com\/v2<br \/>\nkind: MySQLBackup<br \/>\nmetadata:<br \/>\n  name: test-backup-01<br \/>\n  namespace: mysql-cluster<br \/>\nspec:<br \/>\n  clusterName: my-cluster<br \/>\n  # \u8fd9\u91cc\u5f15\u7528\u7684\u5c31\u662f\u6211\u4eec\u5728\u7b2c\u4e09\u6b65\u91cc\u5b9a\u4e49\u7684 profile \u540d\u5b57<br \/>\n  backupProfileName: nfs-profile<\/p>\n<p># \u67e5\u770b\u5907\u4efd\u72b6\u6001<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster get mysqlbackups.mysql.oracle.com -w<br \/>\nNAME             CLUSTER      STATUS   OUTPUT   AGE<br \/>\ntest-backup-01   my-cluster                     6s<br \/>\ntest-backup-01   my-cluster   Running   test-backup-01-20260127-022008   14s<br \/>\ntest-backup-01   my-cluster   Completed   test-backup-01-20260127-022008   16s <\/p>\n<p>\u627e\u5230\u5907\u4efd\u76ee\u5f55MySQL Operator \u4e3a\u4e86\u907f\u514d\u5907\u4efd\u6570\u636e\u4e22\u5931&#xff0c;\u8bbe\u8ba1\u4e0a\u4f1a\u4e3a\u6bcf\u4e00\u6b21\u5907\u4efd\u751f\u6210\u4e00\u4e2a\u552f\u4e00\u7684\u76ee\u5f55\u540d&#xff0c;\u683c\u5f0f\u901a\u5e38\u662f&#xff1a;{\u5907\u4efd\u540d\u79f0}-{\u65e5\u671f}-{\u65f6\u95f4\u6233}\u3002<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl get pv -n mysql-cluster<br \/>\nNAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE<br \/>\npvc-2c7017a9-75ef-4523-94c9-dfcf6a30b819   10Gi       RWX            Delete           Bound    mysql-cluster\/mysql-backup-pvc       nfs-csi        &lt;unset&gt;                          35m<br \/>\npvc-4df4cd5a-35c8-40de-a500-922ebfd8dc2d   10Gi       RWO            Delete           Bound    mysql-cluster\/datadir-my-cluster-2   nfs-csi        &lt;unset&gt;                          34m<br \/>\npvc-c0d0a765-00bd-4d4c-be94-2f2f79d7acc4   10Gi       RWO            Delete           Bound    mysql-cluster\/datadir-my-cluster-1   nfs-csi        &lt;unset&gt;                          34m<br \/>\npvc-e5d7e917-d24e-4835-9798-03de85a6c054   10Gi       RWO            Delete           Bound    mysql-cluster\/datadir-my-cluster-0   nfs-csi        &lt;unset&gt;                          34m<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# cd \/data\/nfs-server\/pvc-2c7017a9-75ef-4523-94c9-dfcf6a30b819\/test-backup-01-20260127-022008\/<br \/>\n[root&#064;k8s-master \/data\/nfs-server\/pvc-2c7017a9-75ef-4523-94c9-dfcf6a30b819\/test-backup-01-20260127-022008]# ll<br \/>\ntotal 308<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo  1504 Jan 27 10:20 &#064;.done.json<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo  1352 Jan 27 10:20 &#064;.json<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo   293 Jan 27 10:20 &#064;.post.sql<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo   293 Jan 27 10:20 &#064;.sql<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 10021 Jan 27 10:20 &#064;.users.sql<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo  2937 Jan 27 10:20 mysql_innodb_cluster_metadata.json<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo 25611 Jan 27 10:20 mysql_innodb_cluster_metadata.sql<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo   819 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_members.json<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo  1271 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_members.sql<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo     9 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_members&#064;&#064;0.tsv.zst<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo     8 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_members&#064;&#064;0.tsv.zst.idx<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo   830 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_views.json<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo  1235 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_views.sql<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo     9 Jan 27 10:20 mysql_innodb_cluster_metadata&#064;async_cluster_views&#064;&#064;0.tsv.zst<br \/>\n-rw-r&#8212;&#8211; 1 27 sudo     8 Jan 27 10:20<br \/>\n&#8230;&#8230; <\/p>\n<p>\u5907\u4efd\u6ca1\u6709\u95ee\u9898&#xff0c;\u7136\u540e\u5c31\u53ef\u4ee5\u5c06\u914d\u7f6e\u4e2d\u4fee\u6539\u4e3a\u5b9a\u65f6\u5907\u4efd\u3002apply\u4e00\u4e0b\u751f\u6548\u5373\u53ef\u3002<\/p>\n<p># \u4fee\u6539mysql-innodb-cluster.yaml\u914d\u7f6e\u4e0b\u9762\u7684\u5907\u4efd\u914d\u7f6e<br \/>\n&#8230;<\/p>\n<p>backupProfiles:<br \/>\n  &#8211; name: nfs-profile<br \/>\n    # \u65b0\u589e&#xff1a;\u5b9a\u65f6\u5907\u4efd\u7684 cron \u8868\u8fbe\u5f0f&#xff08;\u6bcf\u5929\u51cc\u66682\u70b9&#xff09;<br \/>\n    schedule: &#034;0 2 * * *&#034;<br \/>\n    # \u5907\u4efd\u7c7b\u578b&#xff08;dumpInstance \u8868\u793a\u903b\u8f91\u5907\u4efd&#xff09;<br \/>\n    dumpInstance:<br \/>\n      storage:<br \/>\n        # \u7ed1\u5b9a\u5df2\u521b\u5efa\u7684 PVC&#xff08;\u5fc5\u987b\u7528\u5168\u79f0 persistentVolumeClaim&#xff0c;\u4e0d\u80fd\u7b80\u5199&#xff09;<br \/>\n        persistentVolumeClaim:<br \/>\n          claimName: mysql-backup-pvc<br \/>\n    # \u53ef\u9009&#xff1a;\u5907\u4efd\u4fdd\u7559\u7b56\u7565&#xff08;\u907f\u514d\u5907\u4efd\u6587\u4ef6\u5360\u6ee1\u5b58\u50a8&#xff09;<br \/>\n    retention:<br \/>\n      # \u4fdd\u7559\u6700\u8fd17\u5929\u7684\u5907\u4efd<br \/>\n      days: 7<br \/>\n&#8230; <\/p>\n<h3 id=\"3.2%20%E6%95%B0%E6%8D%AE%E6%81%A2%E5%A4%8D%E8%AE%BE%E8%AE%A1\">3.2 \u6570\u636e\u6062\u590d\u8bbe\u8ba1<\/h3>\n<p>\u5b98\u65b9\u63a8\u8350\u6570\u636e\u6062\u590d&#xff1a;\u4f60\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5168\u65b0\u7684 InnoDBCluster&#xff0c;\u5e76\u5728\u521b\u5efa\u65f6\u544a\u8bc9\u5b83&#xff1a;\u201c\u8bf7\u7528\u8fd9\u4e2a\u5907\u4efd\u521d\u59cb\u5316\u81ea\u5df1\u201d\u3002 \u6838\u5fc3\u5b57\u6bb5\u662f spec.initDB\u3002<\/p>\n<p>apiVersion: mysql.oracle.com\/v2<br \/>\nkind: InnoDBCluster<br \/>\nmetadata:<br \/>\n  name: my-cluster-restored  # \u3010\u6ce8\u610f\u3011\u5fc5\u987b\u662f\u4e2a\u65b0\u540d\u5b57&#xff0c;\u4e0d\u80fd\u548c\u65e7\u96c6\u7fa4\u51b2\u7a81<br \/>\n  namespace: mysql-cluster<br \/>\nspec:<br \/>\n  version: &#034;8.4.7&#034;<br \/>\n  instances: 3<br \/>\n  router:<br \/>\n    instances: 1<br \/>\n  secretName: my-root-secret<\/p>\n<p>  # &#8212; \u6838\u5fc3\u6062\u590d\u914d\u7f6e &#8212;<br \/>\n  initDB:<br \/>\n    dump:<br \/>\n      name: nfs-backup-final-20260126-xxx  # \u8fd9\u91cc\u586b\u4f60 NFS \u76ee\u5f55\u4e0b\u5177\u4f53\u7684\u90a3\u4e2a\u6587\u4ef6\u5939\u540d\u5b57<br \/>\n      storage:<br \/>\n        persistentVolumeClaim:<br \/>\n          claimName: mysql-backup-pvc      # \u6307\u5411\u5b58\u653e\u5907\u4efd\u7684\u90a3\u4e2a PVC <\/p>\n<p>\u4e3a\u4ec0\u4e48\u8fd9\u79cd\u65b9\u5f0f\u66f4\u597d&#xff1f;<\/p>\n<li>\n<p>\u5b89\u5168&#xff1a;\u65e7\u96c6\u7fa4&#xff08;\u6848\u53d1\u73b0\u573a&#xff09;\u88ab\u4fdd\u7559\u4e0b\u6765\u4e86&#xff0c;\u5982\u679c\u6062\u590d\u5931\u8d25&#xff0c;\u4f60\u8fd8\u6709\u673a\u4f1a\u53bb\u65e7\u96c6\u7fa4\u91cc\u62a2\u6551\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p>\u539f\u5b50\u6027&#xff1a;\u65b0\u96c6\u7fa4\u542f\u52a8\u65f6&#xff0c;\u8981\u4e48\u662f\u6ee1\u8840\u590d\u6d3b\u7684\u72b6\u6001&#xff0c;\u8981\u4e48\u5c31\u662f\u542f\u52a8\u5931\u8d25&#xff0c;\u4e0d\u4f1a\u51fa\u73b0\u201c\u6570\u636e\u6062\u590d\u4e86\u4e00\u534a\u201d\u7684\u5c34\u5c2c\u72b6\u6001\u3002<\/p>\n<\/li>\n<h3 id=\"3.3%20MySQL%20shell%E6%81%A2%E5%A4%8D%EF%BC%88loadDump%EF%BC%89\">3.3 MySQL shell\u6062\u590d&#xff08;loadDump&#xff09;<\/h3>\n<p>MySQL :: MySQL Shell 8.4 :: 3.1 MySQL Shell Commands<\/p>\n<p>\u5982\u679c\u4f60\u4e0d\u60f3\u6539\u540d\u5b57&#xff08;\u56e0\u4e3a\u4e1a\u52a1\u4ee3\u7801\u53ef\u80fd\u5199\u6b7b\u4e86\u8fde\u63a5\u5730\u5740&#xff09;&#xff0c;\u6216\u8005 initDB \u65b9\u5f0f\u62a5\u9519&#xff08;\u6709\u65f6\u5019 Operator \u5bf9 PVC \u7684\u6302\u8f7d\u8def\u5f84\u652f\u6301\u6709 Bug&#xff09;&#xff0c;\u90a3\u4e48\u6700\u7a33\u3001\u6700\u65e0\u89c6\u7248\u672c\u5dee\u5f02\u7684\u65b9\u6cd5&#xff0c;\u624b\u52a8 MySQL Shell \u5bfc\u5165\u6cd5\u3002<\/p>\n<p>\u6e05\u7406\u65e7\u6570\u636e&#xff08;\u614e\u7528&#xff09;&#xff1a;<\/p>\n<p>\u5982\u679c\u786e\u5b9a\u65e7\u6570\u636e\u4e0d\u8981\u4e86&#xff0c;\u76f4\u63a5\u8fdb\u6570\u636e\u5e93\u5220\u5e93&#xff0c;\u6216\u8005\u91cd\u5efa PVC\u3002 <\/p>\n<p>\u7136\u540e\u4f7f\u7528NFS-Server\u7684\u5907\u4efd\u6062\u590d\u3002<\/p>\n<p>mysqlsh -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30306 \\\\<br \/>\n  &#8211;util loadDump &#034;\/data\/backup\/nfs-backup-final-xxx&#034; \\\\<br \/>\n  &#8211;threads&#061;4 \\\\<br \/>\n  &#8211;resetProgress <\/p>\n<h3 id=\"3.3%20OCI%E5%AF%B9%E8%B1%A1%E5%AD%98%E5%82%A8%E6%81%A2%E5%A4%8D\">3.3 OCI\u5bf9\u8c61\u5b58\u50a8\u6062\u590d<\/h3>\n<p>\u5728 MySQL Operator (8.4&#043;) \u7684\u903b\u8f91\u4e2d&#xff0c;\u4ece OCI \u5bf9\u8c61\u5b58\u50a8\u6062\u590d\u548c\u4ece\u672c\u5730 PVC \u6062\u590d&#xff0c;\u4e0d\u4ec5\u64cd\u4f5c\u903b\u8f91\u4e0d\u540c&#xff0c;\u8fde\u80cc\u540e\u7684\u6280\u672f\u5b9e\u73b0\u90fd\u6709\u5f88\u5927\u5dee\u5f02\u3002<\/p>\n<table>\n<tr>\u7ef4\u5ea6OCI Object Storage (\u5bf9\u8c61\u5b58\u50a8)PersistentVolumeClaim (\u4f60\u7684 NFS\/PV)<\/tr>\n<tbody>\n<tr>\n<td>\u6280\u672f\u8def\u5f84<\/td>\n<td>\u771f\u6b63\u7684\u201c\u4e00\u952e\u6062\u590d\u201d<\/td>\n<td>\u201c\u521d\u59cb\u5316\u201d\u6216\u201c\u624b\u52a8\u5bfc\u5165\u201d<\/td>\n<\/tr>\n<tr>\n<td>Operator \u884c\u4e3a<\/td>\n<td>Operator \u4f1a\u81ea\u52a8\u4e0b\u8f7d\u3001\u89e3\u538b\u3001\u6d41\u5f0f\u5bfc\u5165<\/td>\n<td>Operator \u901a\u5e38\u53ea\u652f\u6301\u5728\u201c\u9996\u6b21\u542f\u52a8\u201d\u65f6\u6302\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>\u7075\u6d3b\u6027<\/td>\n<td>\u652f\u6301\u4ece\u4e91\u7aef\u76f4\u63a5\u201c\u62c9\u53d6\u201d\u5230\u4efb\u4f55\u65b0\u96c6\u7fa4<\/td>\n<td>\u4f9d\u8d56\u7269\u7406\u5377\u7684\u6302\u8f7d&#xff0c;\u8def\u5f84\u548c\u6743\u9650\u5f88\u6b7b\u677f<\/td>\n<\/tr>\n<tr>\n<td>\u914d\u7f6e\u5b57\u6bb5<\/td>\n<td>\u5b98\u65b9\u6587\u6863\u4e3b\u63a8 initDB.ociObjectStorage<\/td>\n<td>\u5b98\u65b9\u6587\u6863\u5bf9 initDB.dump.persistentVolumeClaim \u63cf\u8ff0\u8f83\u5c11<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b98\u65b9&#xff08;Oracle&#xff09;\u7684\u903b\u8f91\u662f&#xff1a;\u5982\u679c\u4f60\u7528\u4ed6\u4eec\u7684\u4e91&#xff08;OCI&#xff09;&#xff0c;\u5b83\u80fd\u5e2e\u4f60\u505a\u5f97\u975e\u5e38\u81ea\u52a8\u5316\u3002<\/p>\n<ul>\n<li>\n<p>\u5bf9\u4e8e OCI&#xff1a;\u652f\u6301\u76f4\u63a5\u5728 InnoDBCluster \u8fd0\u884c\u65f6&#xff0c;\u901a\u8fc7\u67d0\u79cd\u89e6\u53d1\u673a\u5236\u6216\u8005 initDB \u5b8c\u7f8e\u62c9\u53d6\u3002<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u4e8e PVC&#xff1a;\u5b83\u66f4\u503e\u5411\u4e8e\u8ba4\u4e3a\u8fd9\u662f\u4e00\u4e2a\u201c\u5feb\u7167\u201d\u6216\u8005\u201c\u5bfc\u51fa\u76ee\u5f55\u201d\u3002\u6b63\u5982\u4f60\u770b\u5230\u7684&#xff0c;8.4 \u7248\u672c\u5220\u9664\u4e86 MySQLRestore \u8fd9\u79cd\u663e\u5f0f\u7684\u6062\u590d\u6307\u4ee4\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u7684OCIociObjectStorage \u53c2\u6570\u662f\u4e13\u4e3a\u7532\u9aa8\u6587\u4e91&#xff08;Oracle Cloud Infrastructure&#xff09;\u8bbe\u8ba1\u7684\u201c\u4eb2\u513f\u5b50\u201d\u529f\u80fd&#xff0c;\u5176\u4ed6\u4e91\u76ee\u524d\u6ca1\u6709\u8fd9\u79cd\u5f85\u9047&#xff0c;\u4f46\u662f\u4f60\u53ef\u4ee5\u5c06\u4f60\u7684\u5907\u4efd\u5b58\u50a8\u5230\u5176\u4ed6\u7684\u5bf9\u8c61\u5b58\u50a8\u4e0a\u3002<\/p>\n<h3 id=\"3.4%C2%A0%E4%BC%A0%E7%BB%9F%E7%9A%84mysqldump%E5%92%8CXBK%E8%BF%9B%E8%A1%8C%E5%A4%87%E4%BB%BD\">3.4\u00a0\u4f20\u7edf\u7684mysqldump\u548cXBK\u8fdb\u884c\u5907\u4efd<\/h3>\n<p>\u4f46\u662f\u5907\u4efd\u65f6\u5fc5\u987b\u8fde 30307 (RO \u7aef\u53e3)&#xff1a;\u5229\u7528 Router \u7684\u8bfb\u5199\u5206\u79bb&#xff0c;\u628a\u5907\u4efd\u538b\u529b\u5378\u8f7d\u5230\u4ece\u5e93&#xff08;Secondary&#xff09;\u4e0a\u3002<\/p>\n<p>\u65b9\u6848 A&#xff1a;\u4f7f\u7528 mysqldump&#xff08;\u903b\u8f91\u5907\u4efd&#xff0c;\u6700\u7a33&#xff09;<\/p>\n<p>\u9002\u5408\u6570\u636e\u91cf\u5728 50G \u4ee5\u4e0b\u7684\u573a\u666f<\/p>\n<p>mysqldump -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30307 \\\\<br \/>\n  &#8211;all-databases \\\\<br \/>\n  &#8211;single-transaction \\\\<br \/>\n  &#8211;triggers &#8211;routines &#8211;events \\\\<br \/>\n  &#8211;set-gtid-purged&#061;ON \\\\<br \/>\n  &#8211;master-data&#061;2 \\\\<br \/>\n  &gt; \/data\/backup\/full_$(date &#043;%F).sql <\/p>\n<p>\u65b9\u6848 B&#xff1a;\u4f7f\u7528 Xtrabackup&#xff08;\u7269\u7406\u5907\u4efd&#xff0c;\u6700\u5feb&#xff09;<\/p>\n<p>\u5982\u679c\u4f60\u7684\u6570\u636e\u8d85\u8fc7 100G&#xff0c;mysqldump \u6062\u590d\u592a\u6162&#xff0c;\u5efa\u8bae\u7528 XBK\u3002\u4f46\u5728 K8s \u4e2d&#xff0c;XBK \u65e0\u6cd5\u901a\u8fc7\u7f51\u7edc\u76f4\u63a5\u5907\u4efd&#xff0c;\u5b83\u9700\u8981\u7269\u7406\u63a5\u89e6\u6570\u636e\u6587\u4ef6<\/p>\n<p>\u63a8\u8350\u505a\u6cd5&#xff08;Sidecar \u6a21\u5f0f\u6216 CronJob&#xff09;&#xff1a;<\/p>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6 Pod&#xff0c;\u6302\u8f7d\u5176\u4e2d\u4e00\u4e2a\u4ece\u5e93&#xff08;\u5982 my-cluster-2&#xff09;\u7684 PVC\u3002<\/p>\n<\/li>\n<li>\n<p>\u6216\u8005\u901a\u8fc7 kubectl exec \u8fdb\u5230\u4e00\u4e2a\u4ece\u5e93 Pod \u5185\u90e8\u6267\u884c&#xff1a;<\/p>\n<\/li>\n<p># \u8fdb\u5165\u4ece\u5e93\u6267\u884c&#xff0c;\u907f\u514d\u4e3b\u5e93 IO \u963b\u585e<br \/>\nkubectl exec -it my-cluster-2 -n mysql-cluster &#8212; xtrabackup &#8211;backup \\\\<br \/>\n  &#8211;user&#061;root &#8211;password&#061;&#039;String&#064;1307!&#039; \\\\<br \/>\n  &#8211;target-dir&#061;\/var\/lib\/mysql\/backup\/ <\/p>\n<p>\u8003\u8651\u5230\u201c\u4e3b\u4ece\u5207\u6362\u201d\u7684\u7a33\u5065\u7b56\u7565<\/p>\n<p>\u5728 K8s \u4e2d&#xff0c;Pod \u53ef\u80fd\u4f1a\u6f02\u79fb\u3002\u4e3a\u4e86\u786e\u4fdd\u5907\u4efd\u811a\u672c\u4e0d\u5931\u6548&#xff0c;\u81ea\u52a8\u5316\u811a\u672c\u5e94\u8be5\u8fd9\u6837\u5199&#xff1a;<\/p>\n<p>\u903b\u8f91\u6d41&#xff1a;<\/p>\n<li>\n<p>\u63a2\u6d4b\u8c01\u662f\u4ece\u5e93&#xff1a;\u901a\u8fc7 SQL select * from performance_schema.replication_group_members \u786e\u8ba4\u6210\u5458\u72b6\u6001\u3002<\/p>\n<\/li>\n<li>\n<p>\u9501\u5b9a\u76ee\u6807&#xff1a;\u901a\u8fc7 Router \u7684 30307 \u7aef\u53e3\u8fdb\u884c\u8fde\u63a5\u3002\u5373\u4fbf\u53d1\u751f\u4e3b\u4ece\u5207\u6362&#xff0c;Router \u4f1a\u81ea\u52a8\u628a\u4f60\u7684\u5907\u4efd\u8bf7\u6c42\u5bfc\u5411\u65b0\u7684\u4ece\u5e93&#xff0c;\u811a\u672c\u65e0\u9700\u4fee\u6539 IP\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u671f\u6e05\u7406&#xff1a;\u5728 NFS \u4e0a\u4fdd\u7559\u6700\u8fd1 7 \u5929\u7684\u5907\u4efd\u3002<\/p>\n<\/li>\n<p>\u5efa\u8bae\u7684\u5907\u4efd\u8ba1\u5212 (Crontab)<\/p>\n<table>\n<tr>\u9891\u7387\u5907\u4efd\u65b9\u5f0f\u5b58\u50a8\u4f4d\u7f6e\u76ee\u7684<\/tr>\n<tbody>\n<tr>\n<td>\u6bcf 1 \u5c0f\u65f6<\/td>\n<td>\u589e\u91cf\/\u65e5\u5fd7\u5907\u4efd<\/td>\n<td>NFS<\/td>\n<td>\u51cf\u5c11\u6570\u636e\u4e22\u5931\u7a97\u53e3<\/td>\n<\/tr>\n<tr>\n<td>\u6bcf\u5929\u51cc\u6668 2 \u70b9<\/td>\n<td>mysqldump \u5168\u91cf<\/td>\n<td>NFS<\/td>\n<td>\u957f\u671f\u5b58\u6863&#xff0c;\u5e94\u5bf9\u8bef\u5220\u5e93<\/td>\n<\/tr>\n<tr>\n<td>\u6bcf\u5468\/\u6708<\/td>\n<td>Xtrabackup \u5168\u91cf<\/td>\n<td>\u79bb\u7ebf\u5b58\u50a8<\/td>\n<td>\u707e\u96be\u6027\u786c\u4ef6\u6545\u969c\u6062\u590d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u603b\u7ed3\u4e00\u53e5\u8bdd&#xff1a;\u5728 K8s \u91cc\u7528\u4f20\u7edf\u5de5\u5177&#xff0c;\u6838\u5fc3\u5c31\u662f\u201c\u8fde Router \u7684\u53ea\u8bfb\u7aef\u53e3\u505a\u5907\u4efd&#xff0c;\u8fde\u8bfb\u5199\u7aef\u53e3\u505a\u6062\u590d\u201d\u3002<\/p>\n<h2 id=\"%E5%9B%9B%E3%80%81%E9%AA%8C%E8%AF%81%E9%9B%86%E7%BE%A4%E7%8A%B6%E6%80%81\">\u56db\u3001\u9a8c\u8bc1\u96c6\u7fa4\u72b6\u6001<\/h2>\n<h3 id=\"4.1%C2%A0%E6%9F%A5%E7%9C%8B%E9%9B%86%E7%BE%A4%E7%8A%B6%E6%80%81\">4.1\u00a0\u67e5\u770b\u96c6\u7fa4\u72b6\u6001<\/h3>\n<p> [root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster exec -it my-cluster-0 &#8212; mysqlsh<br \/>\nDefaulted container &#034;sidecar&#034; out of: sidecar, mysql, fixdatadir (init), initconf (init), initmysql (init)<br \/>\nMySQL Shell 8.4.7<\/p>\n<p>Copyright (c) 2016, 2025, Oracle and\/or its affiliates.<br \/>\nOracle is a registered trademark of Oracle Corporation and\/or its affiliates.<br \/>\nOther names may be trademarks of their respective owners.<\/p>\n<p>Type &#039;\\\\help&#039; or &#039;\\\\?&#039; for help; &#039;\\\\quit&#039; to exit.<\/p>\n<p># \u8fde\u63a5\u96c6\u7fa4<br \/>\n MySQL  SQL &gt; \\\\connect root&#064;localhost<br \/>\nCreating a session to &#039;root&#064;localhost&#039;<br \/>\nPlease provide the password for &#039;root&#064;localhost&#039;: ************<br \/>\nFetching global names for auto-completion&#8230; Press ^C to stop.<br \/>\nYour MySQL connection id is 17774 (X protocol)<br \/>\nServer version: 8.4.7 MySQL Community Server &#8211; GPL<br \/>\nNo default schema selected; type \\\\use &lt;schema&gt; to set one.<\/p>\n<p># \u6267\u884cSQL\u8bed\u53e5<br \/>\n MySQL  localhost:33060&#043; ssl  SQL &gt; show databases;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| Database                      |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| information_schema            |<br \/>\n| mysql                         |<br \/>\n| mysql_innodb_cluster_metadata |<br \/>\n| performance_schema            |<br \/>\n| sys                           |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n5 rows in set (0.0017 sec)<\/p>\n<p># \u5207\u6362\u8bed\u8a00\u7c7b\u578b<br \/>\n MySQL  localhost:33060&#043; ssl  SQL &gt; \\\\js<br \/>\nSwitching to JavaScript mode&#8230;<\/p>\n<p># \u67e5\u770b\u96c6\u7fa4\u72b6\u6001<br \/>\n MySQL  localhost:33060&#043; ssl  JS &gt; dba.getCluster().status()<br \/>\n{<br \/>\n    &#034;clusterName&#034;: &#034;my_cluster&#034;,<br \/>\n    &#034;defaultReplicaSet&#034;: {<br \/>\n        &#034;name&#034;: &#034;default&#034;,<br \/>\n        &#034;primary&#034;: &#034;my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n        &#034;ssl&#034;: &#034;REQUIRED&#034;,<br \/>\n        &#034;status&#034;: &#034;OK&#034;,<br \/>\n        &#034;statusText&#034;: &#034;Cluster is ONLINE and can tolerate up to ONE failure.&#034;,<br \/>\n        &#034;topology&#034;: {<br \/>\n            &#034;my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;: {<br \/>\n                &#034;address&#034;: &#034;my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n                &#034;memberRole&#034;: &#034;PRIMARY&#034;,<br \/>\n                &#034;mode&#034;: &#034;R\/W&#034;,<br \/>\n                &#034;readReplicas&#034;: {},<br \/>\n                &#034;replicationLag&#034;: &#034;applier_queue_applied&#034;,<br \/>\n                &#034;role&#034;: &#034;HA&#034;,<br \/>\n                &#034;status&#034;: &#034;ONLINE&#034;,<br \/>\n                &#034;version&#034;: &#034;8.4.7&#034;<br \/>\n            },<br \/>\n            &#034;my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;: {<br \/>\n                &#034;address&#034;: &#034;my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n                &#034;memberRole&#034;: &#034;SECONDARY&#034;,<br \/>\n                &#034;mode&#034;: &#034;R\/O&#034;,<br \/>\n                &#034;readReplicas&#034;: {},<br \/>\n                &#034;replicationLag&#034;: &#034;applier_queue_applied&#034;,<br \/>\n                &#034;role&#034;: &#034;HA&#034;,<br \/>\n                &#034;status&#034;: &#034;ONLINE&#034;,<br \/>\n                &#034;version&#034;: &#034;8.4.7&#034;<br \/>\n            },<br \/>\n            &#034;my-cluster-2.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;: {<br \/>\n                &#034;address&#034;: &#034;my-cluster-2.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n                &#034;memberRole&#034;: &#034;SECONDARY&#034;,<br \/>\n                &#034;mode&#034;: &#034;R\/O&#034;,<br \/>\n                &#034;readReplicas&#034;: {},<br \/>\n                &#034;replicationLag&#034;: &#034;applier_queue_applied&#034;,<br \/>\n                &#034;role&#034;: &#034;HA&#034;,<br \/>\n                &#034;status&#034;: &#034;ONLINE&#034;,<br \/>\n                &#034;version&#034;: &#034;8.4.7&#034;<br \/>\n            }<br \/>\n        },<br \/>\n        &#034;topologyMode&#034;: &#034;Single-Primary&#034;<br \/>\n    },<br \/>\n    &#034;groupInformationSourceMember&#034;: &#034;my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;<br \/>\n}<br \/>\n MySQL  localhost:33060&#043; ssl  JS &gt;  <\/p>\n<h3 id=\"4.2%C2%A0%E6%B5%8B%E8%AF%95%E4%B8%BB%E4%BB%8E%E5%A4%8D%E5%88%B6\">4.2\u00a0\u6d4b\u8bd5\u4e3b\u4ece\u590d\u5236<\/h3>\n<p># \u4eceJS\u5207\u6362\u4e3aSQL\u8bed\u8a00<br \/>\nMySQL  localhost:33060&#043; ssl  JS &gt; \\\\sql<br \/>\nSwitching to SQL mode&#8230; Commands end with ;<br \/>\n&#8212; 1. \u521b\u5efa\u6570\u636e\u5e93<br \/>\nCREATE DATABASE sync_test;<\/p>\n<p>&#8212; 2. \u5207\u6362\u6570\u636e\u5e93<br \/>\nUSE sync_test;<\/p>\n<p>&#8212; 3. \u521b\u5efa\u8868<br \/>\nCREATE TABLE users (<br \/>\n    id INT AUTO_INCREMENT PRIMARY KEY,<br \/>\n    name VARCHAR(50),<br \/>\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP<br \/>\n) ENGINE&#061;InnoDB;<\/p>\n<p>&#8212; 4. \u63d2\u5165\u4e00\u6761\u6570\u636e<br \/>\nINSERT INTO users (name) VALUES (&#039;Gemini_Test_Data&#039;);<\/p>\n<p>&#8212; 5. \u67e5\u770b\u6570\u636e<br \/>\n MySQL  localhost:33060&#043; ssl  sync_test  SQL &gt; SELECT * FROM users;<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n| id | name             | created_at          |<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|  1 | Gemini_Test_Data | 2026-01-27 02:47:13 |<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n1 row in set (0.0015 sec)<br \/>\n# \u518d\u6253\u5f00\u4e00\u4e2a\u7a97\u53e3&#xff0c;\u8fde\u63a5\u4ece\u5e93\u67e5\u770b\u6570\u636e<br \/>\n MySQL  localhost:33060&#043; ssl  SQL &gt; SELECT * FROM sync_test.users;<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n| id | name             | created_at          |<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|  1 | Gemini_Test_Data | 2026-01-27 02:47:13 |<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n1 row in set (0.0008 sec)<br \/>\n MySQL  localhost:33060&#043; ssl<br \/>\n\u4e3b\u8282\u70b9\u518d\u63d2\u5165\u6570\u636e\u7136\u540e\u4ece\u8282\u70b9\u67e5\u770b<br \/>\n# master\u8282\u70b9<br \/>\n MySQL  localhost:33060&#043; ssl  sync_test  SQL &gt; INSERT INTO sync_test.users (name) VALUES (&#039;Illegal_Write&#039;);<br \/>\nQuery OK, 1 row affected (0.0084 sec)<br \/>\n MySQL  localhost:33060&#043; ssl  sync_test  SQL &gt; \\\\quit<br \/>\nBye!<br \/>\n#replicas\u8282\u70b9<br \/>\n MySQL  localhost:33060&#043; ssl  SQL &gt; SELECT * FROM sync_test.users;<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n| id | name             | created_at          |<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|  1 | Gemini_Test_Data | 2026-01-27 02:47:13 |<br \/>\n|  2 | Illegal_Write    | 2026-01-27 02:49:20 |<br \/>\n&#043;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n2 rows in set (0.0012 sec)<br \/>\n MySQL  localhost:33060&#043; ssl  SQL &gt; exit<br \/>\n                                 -&gt; ^C<br \/>\n MySQL  localhost:33060&#043; ssl  SQL &gt; \\\\quit<br \/>\nBye! <\/p>\n<h3 id=\"4.3%20%E6%B5%8B%E8%AF%95%E8%AF%BB%E5%86%99%E5%88%86%E7%A6%BB\">4.3 \u6d4b\u8bd5\u8bfb\u5199\u5206\u79bb<\/h3>\n<p>\u7b2c\u4e00\u6b65&#xff1a;\u627e\u51c6\u7aef\u53e3<\/p>\n<p>\u56e0\u4e3a\u76ee\u524d\u4f7f\u7528 NodePort \u66b4\u9732\u7684\u670d\u52a1&#xff0c;\u6bcf\u6b21\u91cd\u5efa\u7aef\u53e3\u53ef\u80fd\u4f1a\u53d8&#xff0c;\u6240\u4ee5\u5148\u786e\u8ba4\u4e00\u4e0b\u5f53\u524d\u7684\u7aef\u53e3\u6620\u5c04&#xff1a;<\/p>\n<p>kubectl get svc -n mysql-cluster <\/p>\n<p>\u8bf7\u91cd\u70b9\u770b my-cluster-router \u8fd9\u4e00\u884c&#xff0c;\u627e\u5230\u5bf9\u5e94\u7684\u6620\u5c04\u5173\u7cfb&#xff1a;<\/p>\n<ul>\n<li>\n<p>RW \u7aef\u53e3 (\u8bfb\u5199)&#xff1a;\u627e\u5230\u6620\u5c04\u5230\u5bb9\u5668 6446 \u7684\u90a3\u4e2a\u7aef\u53e3&#xff08;\u4f8b\u5982 30306&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>RO \u7aef\u53e3 (\u53ea\u8bfb)&#xff1a;\u627e\u5230\u6620\u5c04\u5230\u5bb9\u5668 6447 \u7684\u90a3\u4e2a\u7aef\u53e3&#xff08;\u4f8b\u5982 30307&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u7b2c\u4e8c\u6b65&#xff1a;\u9a8c\u8bc1\u201c\u8bfb\u5199\u7aef\u53e3\u201d (RW Port &#8211; 6446)<\/p>\n<p>\u8fd9\u4e2a\u7aef\u53e3\u662f\u7ed9\u5199\u64cd\u4f5c\u7528\u7684&#xff0c;\u5b83\u5fc5\u987b\u59cb\u7ec8\u6307\u5411 Primary (\u4e3b\u8282\u70b9)\u3002\u6211\u4eec\u8fde\u67e5 3 \u6b21&#xff0c;\u5e94\u8be5\u6bcf\u6b21\u90fd\u8fd4\u56de\u540c\u4e00\u4e2a\u540d\u5b57\u3002<\/p>\n<p>[root&#064;k8s-master ~ ]# apt install -y mysql-client<\/p>\n<p># \u8bb0\u5f97\u66ff\u6362 -P \u540e\u9762\u7684\u7aef\u53e3\u4e3a\u4f60\u67e5\u5230\u7684 6446 \u6620\u5c04\u7aef\u53e3<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# for i in {1..3}; do<br \/>\n  mysql -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30306 -e &#034;select &#064;&#064;hostname;&#034;<br \/>\ndone<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-0 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-0 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-0 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043; <\/p>\n<p>\u2705 \u9884\u671f\u7ed3\u679c&#xff1a; \u8f93\u51fa\u7684 Hostname \u5b8c\u5168\u4e00\u6837&#xff08;\u4f8b\u5982\u5168\u662f my-cluster-0&#xff09;\u3002\u8fd9\u8bf4\u660e\u6d41\u91cf\u5f88\u7a33&#xff0c;\u6ca1\u4e71\u8dd1\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff1a;\u9a8c\u8bc1\u201c\u53ea\u8bfb\u7aef\u53e3\u201d (RO Port &#8211; 6447) \u2014\u2014 \u5173\u952e\u6b65\u9aa4<\/p>\n<p>\u8fd9\u4e2a\u7aef\u53e3\u662f\u7ed9\u8bfb\u64cd\u4f5c\u7528\u7684&#xff0c;\u5b83\u5e94\u8be5\u5728\u6240\u6709 Secondary (\u4ece\u8282\u70b9) \u4e4b\u95f4\u505a\u8d1f\u8f7d\u5747\u8861\u3002\u6211\u4eec\u8fde\u67e5 5 \u6b21&#xff0c;\u5e94\u8be5\u770b\u5230\u540d\u5b57\u5728\u8f6e\u6362\u3002<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# # \u8bb0\u5f97\u66ff\u6362 -P \u540e\u9762\u7684\u7aef\u53e3\u4e3a\u4f60\u67e5\u5230\u7684 6447 \u6620\u5c04\u7aef\u53e3<br \/>\nfor i in {1..5}; do<br \/>\n  mysql -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30307 -e &#034;select &#064;&#064;hostname;&#034;<br \/>\ndone<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-2 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-2 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<\/p>\n<p>&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-2 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043; <\/p>\n<p>\u2705 \u9884\u671f\u7ed3\u679c&#xff1a; \u8f93\u51fa\u7684 Hostname \u4f1a\u5728\u4e0d\u540c\u7684 Pod \u540d\u5b57\u4e4b\u95f4\u8df3\u53d8&#xff08;\u4f8b\u5982 my-cluster-1 -&gt; my-cluster-2 -&gt; my-cluster-1&#8230;&#xff09;\u3002<\/p>\n<p>&#x1f381; \u9644\u52a0\u9898&#xff1a;\u9a8c\u8bc1\u53ea\u8bfb\u5c5e\u6027 (\u9632\u8bef\u5199)<\/p>\n<p>\u4e3a\u4e86\u8bc1\u660e RO \u7aef\u53e3\u771f\u7684\u662f\u201c\u53ea\u8bfb\u201d\u7684&#xff0c;\u54b1\u4eec\u5c1d\u8bd5\u5f80\u91cc\u9762\u63d2\u6570\u636e&#xff0c;\u770b\u770b\u5b83\u4f1a\u4e0d\u4f1a\u62a5\u9519\u3002<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# mysql -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30307 -e &#034;create table test_db.should_fail(id int);&#034;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\nERROR 1290 (HY000) at line 1: The MySQL server is running with the &#8211;super-read-only option so it cannot execute this statement <\/p>\n<p>\u6ca1\u95ee\u9898\u3002<\/p>\n<h3 id=\"4.4%20%E6%B5%8B%E8%AF%95%E9%AB%98%E5%8F%AF%E7%94%A8\">4.4 \u6d4b\u8bd5\u9ad8\u53ef\u7528<\/h3>\n<p>\u53ef\u4ee5\u770b\u5230\u76ee\u524dcluster-0\u662fPRIMARY\u72b6\u6001\u3002<\/p>\n<p> MySQL  localhost:33060&#043; ssl  SQL &gt; SELECT MEMBER_HOST, MEMBER_ROLE, MEMBER_STATE  FROM performance_schema.replication_group_members;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| MEMBER_HOST                                                       | MEMBER_ROLE | MEMBER_STATE |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local | SECONDARY   | ONLINE       |<br \/>\n| my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local | PRIMARY     | ONLINE       |<br \/>\n| my-cluster-2.my-cluster-instances.mysql-cluster.svc.cluster.local | SECONDARY   | ONLINE       |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n3 rows in set (0.0007 sec) <\/p>\n<p>\u6253\u5f00\u591a\u4e2a\u7a97\u53e3\u5b9e\u65f6\u76d1\u63a7MySQL-cluster\u548cinnoDBCluster\u7684\u72b6\u6001<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster get po -w<br \/>\nNAME                                   READY   STATUS      RESTARTS   AGE<br \/>\nmy-cluster-0                           2\/2     Running     0          67m<br \/>\nmy-cluster-1                           2\/2     Running     0          67m<br \/>\nmy-cluster-2                           2\/2     Running     0          67m<br \/>\nmy-cluster-router-67fd998b7-6m865      1\/1     Running     0          65m<br \/>\nmy-cluster-router-67fd998b7-xrrx7      1\/1     Running     0          65m<br \/>\ntest-backup-01-20260127-022008-jjzzk   0\/1     Completed   0          34m<\/p>\n<p>[root&#064;k8s-master ~]# kubectl -n mysql-cluster get innodbclusters.mysql.oracle.com -w<br \/>\nNAME         STATUS   ONLINE   INSTANCES   ROUTERS   AGE<br \/>\nmy-cluster   ONLINE   3        3           2         68m<\/p>\n<p>\u7136\u540e\u5728\u53e6\u5916\u7a97\u53e3\u76f4\u63a5delete\u6389Pod[\u6216\u8005\u76f4\u63a5\u5173\u673a\u4e5f\u884c]<\/p>\n<p>[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl get po -n mysql-cluster<br \/>\nNAME                                   READY   STATUS      RESTARTS   AGE<br \/>\nmy-cluster-0                           2\/2     Running     0          68m<br \/>\nmy-cluster-1                           2\/2     Running     0          68m<br \/>\nmy-cluster-2                           2\/2     Running     0          68m<br \/>\nmy-cluster-router-67fd998b7-6m865      1\/1     Running     0          66m<br \/>\nmy-cluster-router-67fd998b7-xrrx7      1\/1     Running     0          66m<br \/>\ntest-backup-01-20260127-022008-jjzzk   0\/1     Completed   0          35m<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster delete po my-cluster-0<br \/>\npod &#034;my-cluster-0&#034; deleted<\/p>\n<p>\u7136\u540e\u6301\u7eed\u76d1\u63a7MySQL-cluster\u548cinnoDBCluster\u7684\u72b6\u6001&#xff0c;\u76f4\u5230\u96c6\u7fa4\u5728\u77ed\u671f\u5185\u81ea\u52a8\u6062\u590d\u6b63\u5e38<\/p>\n<p># Pod\u4ee5\u53ca\u81ea\u52a8\u6062\u590d<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# kubectl -n mysql-cluster get po -w<br \/>\nNAME                                   READY   STATUS      RESTARTS   AGE<br \/>\nmy-cluster-0                           2\/2     Running     0          67m<br \/>\nmy-cluster-1                           2\/2     Running     0          67m<br \/>\nmy-cluster-2                           2\/2     Running     0          67m<br \/>\nmy-cluster-router-67fd998b7-6m865      1\/1     Running     0          65m<br \/>\nmy-cluster-router-67fd998b7-xrrx7      1\/1     Running     0          65m<br \/>\ntest-backup-01-20260127-022008-jjzzk   0\/1     Completed   0          34m<br \/>\nmy-cluster-0                           2\/2     Terminating   0          69m<br \/>\nmy-cluster-0                           2\/2     Terminating   0          69m<br \/>\nmy-cluster-0                           2\/2     Terminating   0          69m<br \/>\nmy-cluster-0                           2\/2     Terminating   0          69m<br \/>\nmy-cluster-1                           2\/2     Running       0          69m<br \/>\nmy-cluster-1                           2\/2     Running       0          69m<br \/>\nmy-cluster-2                           2\/2     Running       0          69m<br \/>\nmy-cluster-2                           2\/2     Running       0          69m<br \/>\nmy-cluster-0                           2\/2     Terminating   0          69m<br \/>\nmy-cluster-1                           2\/2     Running       0          69m<br \/>\nmy-cluster-2                           2\/2     Running       0          69m<br \/>\nmy-cluster-0                           2\/2     Terminating   0          70m<br \/>\nmy-cluster-0                           0\/2     Completed     0          70m<br \/>\nmy-cluster-0                           0\/2     Completed     0          70m<br \/>\nmy-cluster-0                           0\/2     Completed     0          70m<br \/>\nmy-cluster-0                           0\/2     Pending       0          0s<br \/>\nmy-cluster-0                           0\/2     Pending       0          0s<br \/>\nmy-cluster-0                           0\/2     Init:0\/3      0          0s<br \/>\nmy-cluster-0                           0\/2     Init:0\/3      0          0s<br \/>\nmy-cluster-0                           0\/2     Init:0\/3      0          0s<br \/>\nmy-cluster-0                           0\/2     Init:0\/3      0          1s<br \/>\nmy-cluster-0                           0\/2     Init:1\/3      0          5s<br \/>\nmy-cluster-0                           0\/2     Init:1\/3      0          8s<br \/>\nmy-cluster-0                           0\/2     Init:2\/3      0          10s<br \/>\nmy-cluster-0                           0\/2     PodInitializing   0          12s<br \/>\nmy-cluster-0                           1\/2     Running           0          19s<br \/>\nmy-cluster-0                           1\/2     Running           0          24s<br \/>\nmy-cluster-0                           1\/2     Running           0          25s<br \/>\nmy-cluster-0                           2\/2     Running           0          30s<br \/>\n# InnoDB Cluster\u4e5f\u4ee5\u53ca\u6062\u590d<br \/>\n[root&#064;k8s-master ~]# kubectl -n mysql-cluster get innodbclusters.mysql.oracle.com -w<br \/>\nNAME         STATUS   ONLINE   INSTANCES   ROUTERS   AGE<br \/>\nmy-cluster   ONLINE   3        3           2         68m<br \/>\nmy-cluster   ONLINE   3        3           2         69m<br \/>\nmy-cluster   ONLINE_PARTIAL   2        3           2         69m<br \/>\nmy-cluster   ONLINE_PARTIAL   2        3           2         70m<br \/>\nmy-cluster   ONLINE           3        3           2         71m <\/p>\n<p>\u518d\u6b21\u67e5\u770b\u4e3b\u4ece\u548c\u9ad8\u53ef\u7528\u7684\u5173\u7cfb&#xff0c;\u53ef\u4ee5\u770b\u5230cluster1\u53d8\u6210\u4e86\u65b0\u4e3b<\/p>\n<p> MySQL  localhost:33060&#043; ssl  SQL &gt; SELECT MEMBER_HOST, MEMBER_ROLE, MEMBER_STATE  FROM performance_schema.replication_group_members;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| MEMBER_HOST                                                       | MEMBER_ROLE | MEMBER_STATE |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local | PRIMARY     | ONLINE       |<br \/>\n| my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local | SECONDARY   | ONLINE       |<br \/>\n| my-cluster-2.my-cluster-instances.mysql-cluster.svc.cluster.local | SECONDARY   | ONLINE       |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n3 rows in set (0.0009 sec) <\/p>\n<h3 id=\"4.5%20%E6%A3%80%E6%9F%A5%E9%9B%86%E7%BE%A4%E7%8A%B6%E6%80%81\">4.5 \u68c0\u67e5\u96c6\u7fa4\u72b6\u6001<\/h3>\n<p>\u68c0\u67e5\u8bfb\u5199\u5206\u79bb&#xff0c;\u6ca1\u6709\u95ee\u9898\u5373\u53ef\u3002<\/p>\n<p># \u8bfb\u5199\u5206\u79bb\u4f9d\u7136\u751f\u6548\u5c31\u6ca1\u6709\u95ee\u9898<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# for i in {1..5}; do<br \/>\n  mysql -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30307 -e &#034;select &#064;&#064;hostname;&#034;<br \/>\ndone<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-2 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-0 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-2 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-2 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-0 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]# for i in {1..3}; do<br \/>\n  mysql -u root -p&#039;String&#064;1307!&#039; -h 127.0.0.1 -P 30306 -e &#034;select &#064;&#064;hostname;&#034;<br \/>\ndone<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\nmysql: [Warning] Using a password on the command line interface can be insecure.<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| &#064;&#064;hostname   |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| my-cluster-1 |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n[root&#064;k8s-master ~\/mysql-operator\/resource-yaml]#<br \/>\n MySQL  localhost:33060&#043; ssl  JS &gt; dba.getCluster().status()<br \/>\n{<br \/>\n    &#034;clusterName&#034;: &#034;my_cluster&#034;,<br \/>\n    &#034;defaultReplicaSet&#034;: {<br \/>\n        &#034;name&#034;: &#034;default&#034;,<br \/>\n        &#034;primary&#034;: &#034;my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n        &#034;ssl&#034;: &#034;REQUIRED&#034;,<br \/>\n        &#034;status&#034;: &#034;OK&#034;,<br \/>\n        &#034;statusText&#034;: &#034;Cluster is ONLINE and can tolerate up to ONE failure.&#034;,<br \/>\n        &#034;topology&#034;: {<br \/>\n            &#034;my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;: {<br \/>\n                &#034;address&#034;: &#034;my-cluster-0.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n                &#034;memberRole&#034;: &#034;SECONDARY&#034;,<br \/>\n                &#034;mode&#034;: &#034;R\/O&#034;,<br \/>\n                &#034;readReplicas&#034;: {},<br \/>\n                &#034;replicationLag&#034;: &#034;applier_queue_applied&#034;,<br \/>\n                &#034;role&#034;: &#034;HA&#034;,<br \/>\n                &#034;status&#034;: &#034;ONLINE&#034;,<br \/>\n                &#034;version&#034;: &#034;8.4.7&#034;<br \/>\n            },<br \/>\n            &#034;my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;: {<br \/>\n                &#034;address&#034;: &#034;my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n                &#034;memberRole&#034;: &#034;PRIMARY&#034;,<br \/>\n                &#034;mode&#034;: &#034;R\/W&#034;,<br \/>\n                &#034;readReplicas&#034;: {},<br \/>\n                &#034;replicationLag&#034;: &#034;applier_queue_applied&#034;,<br \/>\n                &#034;role&#034;: &#034;HA&#034;,<br \/>\n                &#034;status&#034;: &#034;ONLINE&#034;,<br \/>\n                &#034;version&#034;: &#034;8.4.7&#034;<br \/>\n            },<br \/>\n            &#034;my-cluster-2.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;: {<br \/>\n                &#034;address&#034;: &#034;my-cluster-2.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;,<br \/>\n                &#034;memberRole&#034;: &#034;SECONDARY&#034;,<br \/>\n                &#034;mode&#034;: &#034;R\/O&#034;,<br \/>\n                &#034;readReplicas&#034;: {},<br \/>\n                &#034;replicationLag&#034;: &#034;applier_queue_applied&#034;,<br \/>\n                &#034;role&#034;: &#034;HA&#034;,<br \/>\n                &#034;status&#034;: &#034;ONLINE&#034;,<br \/>\n                &#034;version&#034;: &#034;8.4.7&#034;<br \/>\n            }<br \/>\n        },<br \/>\n        &#034;topologyMode&#034;: &#034;Single-Primary&#034;<br \/>\n    },<br \/>\n    &#034;groupInformationSourceMember&#034;: &#034;my-cluster-1.my-cluster-instances.mysql-cluster.svc.cluster.local:3306&#034;<br \/>\n}<br \/>\n MySQL  localhost:33060&#043; ssl  JS &gt; \\\\quit<br \/>\nBye! <\/p>\n<h2 id=\"%E4%BA%94%E3%80%81%E5%9F%BA%E7%A1%80%E8%BF%90%E7%BB%B4MySQL%20Shell%E5%91%BD%E4%BB%A4\">\u4e94\u3001\u57fa\u7840\u8fd0\u7ef4MySQL Shell\u547d\u4ee4<\/h2>\n<p>MySQL :: MySQL Shell 8.4<\/p>\n<p>MySQL Shell \u662f Operator \u7684 \u201c\u5e95\u5c42\u6267\u884c\u5f15\u64ce\u201d&#xff0c;\u800c\u63a5\u89e6\u7684\u662f Operator \u5c01\u88c5\u540e\u7684 K8s CR\/Helm \u7b49 \u201c\u4e0a\u5c42\u8fd0\u7ef4\u63a5\u53e3\u201d\u3002<\/p>\n<p>MySQL Operator \u5e95\u5c42\u51e0\u4e4e\u6240\u6709\u6838\u5fc3\u8fd0\u7ef4\u64cd\u4f5c&#xff0c;\u90fd\u662f\u901a\u8fc7\u8c03\u7528 MySQL Shell \u5b9e\u73b0\u7684&#xff0c;\u4f46\u4f60\u4f5c\u4e3a\u4f7f\u7528\u8005&#xff0c;\u65e5\u5e38\u8fd0\u7ef4\u5e76\u4e0d\u9700\u8981\u76f4\u63a5\u5199 MySQL Shell \u547d\u4ee4&#xff08;\u9664\u975e\u662f\u624b\u52a8\u8c03\u8bd5 \/ \u6062\u590d\u8fd9\u7c7b\u7279\u6b8a\u573a\u666f&#xff09;\u3002<\/p>\n<h3 id=\"5.1%C2%A0%E6%A0%B8%E5%BF%83%E8%BF%9E%E6%8E%A5%E4%B8%8E%E4%BC%9A%E8%AF%9D%E7%AE%A1%E7%90%86\">5.1\u00a0\u6838\u5fc3\u8fde\u63a5\u4e0e\u4f1a\u8bdd\u7ba1\u7406<\/h3>\n<table>\n<tr>\u547d\u4ee4&#xff08;\u542b\u522b\u540d&#xff09;\u6838\u5fc3\u529f\u80fd\u5b9e\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td style=\"width:118px\">\\\\connect&#xff08;\\\\c&#xff09;<\/td>\n<td style=\"width:172px\">\u8fde\u63a5 MySQL \u5b9e\u4f8b&#xff08;\u652f\u6301\u591a\u534f\u8bae&#xff09;<\/td>\n<td style=\"width:399px\">\n<p>\\\\c root&#064;127.0.0.1:3306&#xff08;\u7ecf\u5178\u534f\u8bae&#xff09;&#xff1b;<\/p>\n<p>\\\\c &#8211;mysqlx root&#064;localhost:33060&#xff08;X \u534f\u8bae&#xff09;&#xff1b;<\/p>\n<p>\\\\c &#8211;ssh root&#064;192.168.1.100:22 root&#064;localhost:3306&#xff08;SSH \u96a7\u9053&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:118px\">\\\\reconnect<\/td>\n<td style=\"width:172px\">\u91cd\u65b0\u8fde\u63a5\u5f53\u524d\u5b9e\u4f8b&#xff08;\u8fde\u63a5\u65ad\u5f00\u65f6\u7528&#xff09;<\/td>\n<td style=\"width:399px\">\u76f4\u63a5\u8f93\u5165&#xff1a;\\\\reconnect<\/td>\n<\/tr>\n<tr>\n<td style=\"width:118px\">\\\\disconnect<\/td>\n<td style=\"width:172px\">\u65ad\u5f00\u5168\u5c40\u4f1a\u8bdd&#xff08;\u4fdd\u7559 MySQL Shell \u4e0d\u9000\u51fa&#xff09;<\/td>\n<td style=\"width:399px\">\u76f4\u63a5\u8f93\u5165&#xff1a;\\\\disconnect<\/td>\n<\/tr>\n<tr>\n<td style=\"width:118px\">\\\\status&#xff08;\\\\s&#xff09;<\/td>\n<td style=\"width:172px\">\u67e5\u770b\u5f53\u524d\u8fde\u63a5\u72b6\u6001&#xff08;\u5b9e\u4f8b\u4fe1\u606f\u3001\u5b57\u7b26\u96c6\u3001 uptime \u7b49&#xff09;<\/td>\n<td style=\"width:399px\">\u76f4\u63a5\u8f93\u5165&#xff1a;\\\\s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"5.2%20%E6%A8%A1%E5%BC%8F%E5%88%87%E6%8D%A2%E4%B8%8E%E8%84%9A%E6%9C%AC%E6%89%A7%E8%A1%8C%EF%BC%88%E5%A4%9A%E8%AF%AD%E8%A8%80%E9%80%82%E9%85%8D%EF%BC%89\">5.2 \u6a21\u5f0f\u5207\u6362\u4e0e\u811a\u672c\u6267\u884c&#xff08;\u591a\u8bed\u8a00\u9002\u914d&#xff09;<\/h3>\n<table>\n<tr>\u547d\u4ee4\u6838\u5fc3\u529f\u80fd\u5b9e\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>\\\\sql<\/td>\n<td>\u5207\u6362\u5230 SQL \u6a21\u5f0f&#xff08;\u6267\u884c\u6807\u51c6 SQL&#xff09;<\/td>\n<td>\u8f93\u5165 \\\\sql \u540e&#xff0c;\u76f4\u63a5\u5199 SQL&#xff1a;SELECT * FROM test.t1;<\/td>\n<\/tr>\n<tr>\n<td>\\\\js<\/td>\n<td>\u5207\u6362\u5230 JavaScript \u6a21\u5f0f&#xff08;\u8c03\u7528 AdminAPI\/X DevAPI&#xff09;<\/td>\n<td>\u8f93\u5165 \\\\js \u540e&#xff0c;\u6267\u884c&#xff1a;dba.status()&#xff08;\u96c6\u7fa4\u72b6\u6001&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\\\\py<\/td>\n<td>\u5207\u6362\u5230 Python \u6a21\u5f0f&#xff08;\u8bed\u6cd5\u9002\u914d Python&#xff09;<\/td>\n<td>\u8f93\u5165 \\\\py \u540e&#xff0c;\u6267\u884c&#xff1a;dba.get_cluster()<\/td>\n<\/tr>\n<tr>\n<td>\\\\source&#xff08;\\\\.\/source&#xff09;<\/td>\n<td>\u6267\u884c\u811a\u672c\u6587\u4ef6&#xff08;\u6309\u5f53\u524d\u6a21\u5f0f\u89e3\u6790&#xff09;<\/td>\n<td>\\\\source \/tmp\/init.sql&#xff08;SQL \u6a21\u5f0f\u6267\u884c SQL \u811a\u672c&#xff09;&#xff1b;\\\\source \/tmp\/backup.js&#xff08;JS \u6a21\u5f0f\u6267\u884c\u811a\u672c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"5.3%C2%A0%E5%A4%87%E4%BB%BD%E6%81%A2%E5%A4%8D%E4%B8%8E%E9%9B%86%E7%BE%A4%E8%BF%90%E7%BB%B4\">5.3\u00a0\u5907\u4efd\u6062\u590d\u4e0e\u96c6\u7fa4\u8fd0\u7ef4<\/h3>\n<table>\n<tr>\u547d\u4ee4 \/ \u5de5\u5177\u7c7b\u6838\u5fc3\u529f\u80fd\u5b9e\u7528\u793a\u4f8b&#xff08;\u7ed3\u5408\u4e4b\u524d\u573a\u666f&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>util.dumpInstance()<\/td>\n<td>\u903b\u8f91\u5907\u4efd\u6574\u4e2a\u5b9e\u4f8b&#xff08;Operator \u5907\u4efd\u5e95\u5c42\u547d\u4ee4&#xff09;<\/td>\n<td>JS \u6a21\u5f0f&#xff1a;util.dumpInstance(&#039;\/data\/backup&#039;, {threads:4})<\/td>\n<\/tr>\n<tr>\n<td>util.loadDump()<\/td>\n<td>\u6062\u590d dumpInstance \u5907\u4efd&#xff08;\u9002\u914d Operator \u5907\u4efd\u6587\u4ef6&#xff09;<\/td>\n<td>\u547d\u4ee4\u884c\u76f4\u63a5\u6267\u884c&#xff1a;mysqlsh -u root -p&#039;pass&#039; &#8211;util loadDump \/data\/backup &#8211;threads&#061;4<\/td>\n<\/tr>\n<tr>\n<td>dba.createCluster()<\/td>\n<td>\u521b\u5efa InnoDB Cluster&#xff08;Operator \u96c6\u7fa4\u521d\u59cb\u5316\u5e95\u5c42\u547d\u4ee4&#xff09;<\/td>\n<td>JS \u6a21\u5f0f&#xff1a;dba.createCluster(&#039;mycluster&#039;)<\/td>\n<\/tr>\n<tr>\n<td>dba.getCluster().status()<\/td>\n<td>\u67e5\u770b\u96c6\u7fa4\u72b6\u6001&#xff08;\u6545\u969c\u6392\u67e5\u7528&#xff09;<\/td>\n<td>JS \u6a21\u5f0f&#xff1a;var cluster &#061; dba.getCluster(); cluster.status();<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"%E5%85%AD%E3%80%81%E6%80%BB%E7%BB%93\">\u516d\u3001\u603b\u7ed3<\/h2>\n<p>\u5728\u4e91\u539f\u751f\u6280\u672f\u5e2d\u5377\u5168\u7403\u7684\u5f53\u4e0b&#xff0c;\u6570\u636e\u5e93\u7684\u5bb9\u5668\u5316\u3001\u81ea\u52a8\u5316\u7ba1\u7406\u5df2\u6210\u4e3a\u4f01\u4e1a\u6570\u5b57\u5316\u8f6c\u578b\u7684\u6838\u5fc3\u9700\u6c42\u4e4b\u4e00&#xff0c;\u800c MySQL Operator for Kubernetes \u6b63\u662f\u4e3a\u89e3\u51b3\u8fd9\u4e00\u9700\u6c42\u800c\u751f\u7684\u6807\u6746\u65b9\u6848 \u2014\u2014 \u5b83\u4ee5 CRD&#xff08;\u81ea\u5b9a\u4e49\u8d44\u6e90&#xff09;\u4e3a\u5e95\u5c42\u57fa\u77f3&#xff0c;\u4e32\u8054\u8d77\u4ece\u90e8\u7f72\u3001\u8fd0\u7ef4\u3001\u9a8c\u8bc1\u5230\u6570\u636e\u5b89\u5168\u7684\u5168\u94fe\u8def\u80fd\u529b&#xff0c;\u5c06 MySQL \u7684\u9ad8\u53ef\u7528\u7279\u6027\u4e0e Kubernetes \u7684\u4e91\u539f\u751f\u4f18\u52bf\u6df1\u5ea6\u878d\u5408&#xff0c;\u4e3a MySQL \u96c6\u7fa4\u7ba1\u7406\u63d0\u4f9b\u4e86\u4e00\u5957\u6807\u51c6\u5316\u3001\u81ea\u52a8\u5316\u3001\u53ef\u6269\u5c55\u7684\u5b8c\u6574\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4ece\u6838\u5fc3\u903b\u8f91\u6765\u770b&#xff0c;\u6574\u5957\u65b9\u6848\u7684\u8bbe\u8ba1\u6781\u5177\u5de7\u601d&#xff1a;InnoDBCluster \u81ea\u5b9a\u4e49\u8d44\u6e90\u4f5c\u4e3a\u6807\u51c6\u5316\u914d\u7f6e\u5165\u53e3&#xff0c;\u8ba9\u7528\u6237\u65e0\u9700\u5173\u6ce8\u590d\u6742\u7684\u5e95\u5c42\u7ec6\u8282&#xff0c;\u4ec5\u901a\u8fc7\u7b80\u5355\u7684 YAML \u6e05\u5355\u5373\u53ef\u5b9a\u4e49\u96c6\u7fa4\u9700\u6c42&#xff1b;MySQL Operator \u626e\u6f14 \u201c\u81ea\u52a8\u5316\u7ba1\u5bb6\u201d \u7684\u6838\u5fc3\u89d2\u8272&#xff0c;\u6301\u7eed\u76d1\u542c CRD \u72b6\u6001\u53d8\u5316&#xff0c;\u81ea\u52a8\u5b8c\u6210 StatefulSet \u90e8\u7f72\u3001Group Replication \u914d\u7f6e\u3001Router \u642d\u5efa\u7b49\u4e00\u7cfb\u5217\u8fd0\u7ef4\u64cd\u4f5c&#xff0c;\u5168\u7a0b\u65e0\u9700\u4eba\u5de5\u4ecb\u5165&#xff1b;InnoDB Cluster \u4f5c\u4e3a\u6570\u636e\u5e93\u96c6\u7fa4\u7684 \u201c\u6838\u5fc3\u5b9e\u4f53\u201d&#xff0c;\u901a\u8fc7\u4e3b\u4ece\u590d\u5236\u5b9e\u73b0\u6570\u636e\u5b9e\u65f6\u540c\u6b65&#xff0c;\u5929\u7136\u89c4\u907f\u5355\u70b9\u6545\u969c&#xff1b;\u800c MySQL Router \u5219\u4ee5 \u201c\u667a\u80fd\u7f51\u5173\u201d \u8eab\u4efd&#xff0c;\u4e3a\u5e94\u7528\u63d0\u4f9b\u7a33\u5b9a\u8bbf\u95ee\u5165\u53e3\u4e0e\u8bfb\u5199\u5206\u79bb\u80fd\u529b&#xff0c;\u5b8c\u7f8e\u5c4f\u853d\u96c6\u7fa4\u62d3\u6251\u53d8\u5316\u5bf9\u4e0a\u5c42\u4e1a\u52a1\u7684\u5f71\u54cd\u3002\u8fd9\u56db\u5927\u6838\u5fc3\u8981\u7d20\u76f8\u4e92\u652f\u6491&#xff0c;\u6784\u5efa\u8d77\u4e00\u5957\u534f\u540c\u9ad8\u6548\u3001\u7a33\u5b9a\u53ef\u9760\u7684\u7ec4\u4ef6\u751f\u6001\u3002<\/p>\n<p>\u5728\u843d\u5730\u5b9e\u8df5\u5c42\u9762&#xff0c;\u65b9\u6848\u7684\u6613\u7528\u6027\u4e0e\u5b9e\u7528\u6027\u5c24\u4e3a\u7a81\u51fa&#xff1a;\u67b6\u6784\u5b9e\u73b0\u9636\u6bb5&#xff0c;\u4ece Operator \u4e0e CRD \u7684\u5feb\u901f\u5b89\u88c5&#xff0c;\u5230 InnoDB Cluster \u4e0e Router \u7684\u4e00\u952e\u90e8\u7f72\u3001\u8def\u7531\u66b4\u9732&#xff0c;\u6d41\u7a0b\u7b80\u6d01\u6e05\u6670&#xff0c;\u914d\u5408\u955c\u50cf\u62c9\u53d6\u7b49\u5b9e\u7528\u5f69\u86cb&#xff0c;\u5927\u5e45\u964d\u4f4e\u4e86\u4e91\u539f\u751f\u65b0\u624b\u7684\u5165\u95e8\u95e8\u69db&#xff1b;\u6570\u636e\u5b89\u5168\u5c42\u9762&#xff0c;\u8986\u76d6 dumpInstance\/loadDump \u539f\u751f\u5de5\u5177\u3001OCI \u5bf9\u8c61\u5b58\u50a8\u5907\u4efd\u3001\u4f20\u7edf mysqldump \u4e0e XBK \u7b49\u591a\u79cd\u5907\u4efd\u6062\u590d\u65b9\u5f0f&#xff0c;\u65e2\u9002\u914d\u4e91\u539f\u751f\u573a\u666f&#xff0c;\u53c8\u517c\u5bb9\u4f20\u7edf\u8fd0\u7ef4\u4e60\u60ef&#xff0c;\u5168\u65b9\u4f4d\u4fdd\u969c\u6570\u636e\u4e0d\u4e22\u5931&#xff1b;\u96c6\u7fa4\u9a8c\u8bc1\u73af\u8282&#xff0c;\u901a\u8fc7\u96c6\u7fa4\u72b6\u6001\u67e5\u770b\u3001\u4e3b\u4ece\u590d\u5236\u6d4b\u8bd5\u3001\u8bfb\u5199\u5206\u79bb\u9a8c\u8bc1\u3001\u9ad8\u53ef\u7528\u6545\u969c\u6f14\u7ec3\u7b49\u5168\u65b9\u4f4d\u624b\u6bb5&#xff0c;\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u786e\u8ba4\u96c6\u7fa4\u662f\u5426\u8fbe\u5230\u751f\u4ea7\u7ea7\u6807\u51c6&#xff1b;\u65e5\u5e38\u8fd0\u7ef4\u5c42\u9762&#xff0c;MySQL Shell \u63d0\u4f9b\u4e86\u7edf\u4e00\u7684\u547d\u4ee4\u96c6&#xff0c;\u6db5\u76d6\u8fde\u63a5\u7ba1\u7406\u3001\u6a21\u5f0f\u5207\u6362\u3001\u96c6\u7fa4\u8fd0\u7ef4\u3001\u5907\u4efd\u6062\u590d\u7b49\u6838\u5fc3\u80fd\u529b&#xff0c;\u4e14\u652f\u6301\u591a\u8bed\u8a00\u811a\u672c\u6267\u884c&#xff0c;\u663e\u8457\u964d\u4f4e\u4e86\u8fd0\u7ef4\u4eba\u5458\u7684\u5b66\u4e60\u6210\u672c\u4e0e\u64cd\u4f5c\u590d\u6742\u5ea6\u3002<\/p>\n<p>\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u8fd9\u5957\u65b9\u6848\u5e76\u975e\u7b80\u5355\u7684 \u201c\u6280\u672f\u5806\u780c\u201d&#xff0c;\u800c\u662f\u771f\u6b63\u5207\u4e2d\u4e86\u5f00\u53d1\u8005\u4e0e\u8fd0\u7ef4\u4eba\u5458\u7684\u6838\u5fc3\u75db\u70b9&#xff1a;\u5f00\u53d1\u8005\u65e0\u9700\u6df1\u5165\u94bb\u7814 MySQL \u5e95\u5c42\u590d\u5236\u539f\u7406\u4e0e K8s \u8d44\u6e90\u8c03\u5ea6\u903b\u8f91&#xff0c;\u5373\u53ef\u5feb\u901f\u642d\u5efa\u9ad8\u53ef\u7528\u6d4b\u8bd5\u73af\u5883&#xff1b;\u8fd0\u7ef4\u4eba\u5458\u65e0\u9700\u9762\u5bf9\u7e41\u7410\u7684\u624b\u52a8\u914d\u7f6e\u4e0e\u6545\u969c\u6392\u67e5&#xff0c;\u5373\u53ef\u5b9e\u73b0\u96c6\u7fa4\u7684\u89c4\u6a21\u5316\u7ba1\u7406\u4e0e\u5f39\u6027\u6269\u5c55&#xff0c;\u5927\u5e45\u63d0\u5347\u8fd0\u7ef4\u6548\u7387\u3001\u964d\u4f4e\u4eba\u4e3a\u5931\u8bef\u98ce\u9669\u3002\u65e0\u8bba\u662f\u4e2d\u5c0f\u578b\u4f01\u4e1a\u7684\u8f7b\u91cf\u5316\u90e8\u7f72&#xff0c;\u8fd8\u662f\u5927\u578b\u4f01\u4e1a\u7684\u89c4\u6a21\u5316\u96c6\u7fa4\u7ba1\u7406&#xff0c;\u8fd9\u5957\u65b9\u6848\u90fd\u80fd\u51ed\u501f\u5176\u826f\u597d\u7684\u6269\u5c55\u6027\u4e0e\u9002\u914d\u6027\u7075\u6d3b\u5e94\u5bf9\u3002<\/p>\n<p>\u603b\u800c\u8a00\u4e4b&#xff0c;MySQL Operator for Kubernetes \u4e0d\u4ec5\u662f\u4e00\u5957\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177&#xff0c;\u66f4\u662f\u4e91\u539f\u751f\u65f6\u4ee3 MySQL \u9ad8\u53ef\u7528\u96c6\u7fa4\u7ba1\u7406\u7684 \u201c\u6700\u4f73\u5b9e\u8df5\u201d\u3002\u5b83\u4ee5\u81ea\u52a8\u5316\u7b80\u5316\u590d\u6742\u8fd0\u7ef4&#xff0c;\u4ee5\u6807\u51c6\u5316\u4fdd\u969c\u73af\u5883\u4e00\u81f4\u6027&#xff0c;\u4ee5\u591a\u573a\u666f\u9002\u914d\u6ee1\u8db3\u4e0d\u540c\u4e1a\u52a1\u9700\u6c42&#xff0c;\u8ba9 MySQL \u6570\u636e\u5e93\u5728\u5bb9\u5668\u5316\u751f\u6001\u4e2d\u5b9e\u73b0 \u201c\u5373\u90e8\u7f72\u3001\u5373\u53ef\u7528\u3001\u5373\u7a33\u5b9a\u201d&#xff0c;\u6210\u4e3a\u4f01\u4e1a\u5728\u4e91\u539f\u751f\u8f6c\u578b\u8def\u4e0a\u503c\u5f97\u4fe1\u8d56\u7684\u6570\u636e\u5e93\u7ba1\u7406\u4f18\u9009\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b98\u7f51\u5730\u5740&#xff1a;MySQL :: MySQL Operator for Kubernetes Manual \u5f00\u6e90\u5730\u5740&#xff1a;mysql\/mysql-operator: MySQL Operator for Kubernetes \u4e00\u3001\u5f15\u8a00\u4e0e\u4ecb\u7ecd<br \/>\nMySQL Operator for Kubernetes \u662f Kubernetes \u751f\u6001\u4e2d\u4e13\u4e3a MySQL \u8bbe\u8ba1\u7684\u4e13\u5c5e\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u6838\u5fc3\u57fa\u4e8eCRD&#xff08;\u81ea\u5b9a\u4e49\u8d44\u6e90&#xff09; \u5b9e\u73b0&amp;#xff0<\/p>\n","protected":false},"author":2,"featured_media":69219,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[120,114,763],"topic":[],"class_list":["post-69226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-kubernetes","tag-mysql","tag-763"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/69226.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5b98\u7f51\u5730\u5740&#xff1a;MySQL :: MySQL Operator for Kubernetes Manual \u5f00\u6e90\u5730\u5740&#xff1a;mysql\/mysql-operator: MySQL Operator for Kubernetes \u4e00\u3001\u5f15\u8a00\u4e0e\u4ecb\u7ecd MySQL Operator for Kubernetes \u662f Kubernetes \u751f\u6001\u4e2d\u4e13\u4e3a MySQL \u8bbe\u8ba1\u7684\u4e13\u5c5e\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u6838\u5fc3\u57fa\u4e8eCRD&#xff08;\u81ea\u5b9a\u4e49\u8d44\u6e90&#xff09; \u5b9e\u73b0&amp;#xff0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/69226.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-31T01:08:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010849-697d5621199b9.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"21 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69226.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/69226.html\",\"name\":\"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-31T01:08:52+00:00\",\"dateModified\":\"2026-01-31T01:08:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/69226.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/69226.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69226.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/69226.html","og_locale":"zh_CN","og_type":"article","og_title":"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5b98\u7f51\u5730\u5740&#xff1a;MySQL :: MySQL Operator for Kubernetes Manual \u5f00\u6e90\u5730\u5740&#xff1a;mysql\/mysql-operator: MySQL Operator for Kubernetes \u4e00\u3001\u5f15\u8a00\u4e0e\u4ecb\u7ecd MySQL Operator for Kubernetes \u662f Kubernetes \u751f\u6001\u4e2d\u4e13\u4e3a MySQL \u8bbe\u8ba1\u7684\u4e13\u5c5e\u8fd0\u7ef4\u5de5\u5177&#xff0c;\u6838\u5fc3\u57fa\u4e8eCRD&#xff08;\u81ea\u5b9a\u4e49\u8d44\u6e90&#xff09; \u5b9e\u73b0&amp;#xff0","og_url":"https:\/\/www.wsisp.com\/helps\/69226.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-31T01:08:52+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260131010849-697d5621199b9.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"21 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/69226.html","url":"https:\/\/www.wsisp.com\/helps\/69226.html","name":"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-31T01:08:52+00:00","dateModified":"2026-01-31T01:08:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/69226.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/69226.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/69226.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"MySQL Operator for Kubernetes\u81ea\u52a8\u5b9e\u73b0\u6574\u4e2a\u751f\u547d\u5468\u671f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/69226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=69226"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/69226\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/69219"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=69226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=69226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=69226"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=69226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}