{"id":27699,"date":"2024-11-24T14:29:10","date_gmt":"2024-11-24T06:29:10","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27699\/"},"modified":"2024-11-24T14:29:10","modified_gmt":"2024-11-24T06:29:10","slug":"kubernetes-%e9%83%a8%e7%bd%b2-mysql-5-7-%e9%81%87%e5%88%b0-crashloopbackoff-%e9%94%99%e8%af%af%ef%bc%9a%e5%a6%82%e4%bd%95%e6%8e%92%e6%9f%a5-mysqld-failed-while-attempting-to-check-config-%e9%97%ae-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27699\/","title":{"rendered":"Kubernetes \u90e8\u7f72 MySQL 5.7 \u9047\u5230 CrashLoopBackOff \u9519\u8bef\uff1a\u5982\u4f55\u6392\u67e5 mysqld failed while attempting to check config \u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173130664730226.jpg\" class=\"aligncenter\" title=\"Kubernetes \u90e8\u7f72 MySQL 5.7 \u9047\u5230 CrashLoopBackOff \u9519\u8bef\uff1a\u5982\u4f55\u6392\u67e5 mysqld failed while attempting to check config \u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"Kubernetes \u90e8\u7f72 MySQL 5.7 \u9047\u5230 CrashLoopBackOff \u9519\u8bef\uff1a\u5982\u4f55\u6392\u67e5 mysqld failed while attempting to check config \u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>kubernetes \u90e8\u7f72  5.7 \u62a5\u9519 crashloopbackoff<\/strong><\/p>\n<p>\u95ee\u9898\uff1a<\/p>\n<p>\u5728 kubernetes \u96c6\u7fa4\u4e2d\u90e8\u7f72 mysql 5.7 \u65f6\uff0cpod \u5904\u4e8e crashloopbackoff \u72b6\u6001\uff0c\u5e76\u8f93\u51fa\u9519\u8bef\u6d88\u606f\uff1amysqld fled while attempting to check config\u3002<\/p>\n<p>\u539f\u56e0\uff1a<\/p>\n<p>\u68c0\u67e5\u914d\u7f6e\u65f6\u51fa\u9519\uff0c\u53ef\u80fd\u662f\u914d\u7f6e\u6587\u4ef6\u6709\u8bef\u6240\u81f4\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u67e5\u770b mysqld.cnf \u6587\u4ef6\uff0c\u786e\u4fdd\u914d\u7f6e\u6b63\u786e\u65e0\u8bef\u3002<\/li>\n<li>\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5\u542f\u52a8\u811a\u672c\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u8ba4 \/usr\/bin\/mysql_entrypoint \u811a\u672c\u7684\u5185\u5bb9\u6b63\u786e\u3002<\/li>\n<li>\u786e\u4fdd\u811a\u672c\u80fd\u591f\u6b63\u786e\u6267\u884c mysql_install_db \u547d\u4ee4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5\u5bb9\u5668\u73af\u5883\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u5bb9\u5668\u4e2d\u5b89\u88c5\u4e86\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002<\/li>\n<li>\u786e\u4fdd\u5bb9\u5668\u4e2d\u7684\u7528\u6237\u5177\u6709\u9002\u5f53\u7684\u6743\u9650\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5\u5b58\u50a8\u5377\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u5206\u914d\u7ed9 mysql \u6301\u4e45\u5377\u7684\u5b58\u50a8\u7a7a\u95f4\u8db3\u591f\u3002<\/li>\n<li>\u786e\u4fdd\u5377\u7684\u8bbf\u95ee\u6a21\u5f0f\u4e0e\u5bb9\u5668\u914d\u7f6e\u76f8\u5339\u914d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u91cd\u65b0\u90e8\u7f72 pod\uff1a<\/strong><\/p>\n<ul>\n<li>\u5220\u9664\u62a5\u9519\u7684 pod\u3002<\/li>\n<li>\u91cd\u65b0\u521b\u5efa pod\uff0c\u786e\u4fdd\u66f4\u65b0\u4e86\u4fee\u590d\u540e\u7684\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u4ee5\u4e0b\u662f\u90e8\u5206\u6d89\u53ca\u7684\u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n<p><strong>deployment yaml\uff1a<\/strong><\/p>\n<pre>apiversion: apps\/v1\nkind: deployment\nmetadata:\n  name: mysql-deployment\nspec:\n  replicas: 1\n  selector:\n    matchlabels:\n      app: mysql\n  template:\n    metadata:\n      labels:\n        app: mysql\n    spec:\n      containers:\n      - name: mysql\n        image: mysql:5.7\n        env:\n        - name: mysql_root_password\n          value: root\n        ports:\n        - containerport: 3306\n        volumemounts:\n        - mountpath: \/var\/lib\/mysql\n          name: mysql-storage\n      volumes:\n      - name: mysql-storage\n        persistentvolumeclaim:\n          claimname: mysql-pvc<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>persistentvolume yaml\uff1a<\/strong><\/p>\n<pre>apiversion: v1\nkind: persistentvolume\nmetadata:\n  name: mysql-pv\nspec:\n  capacity:\n    storage: 10gi\n  accessmodes:\n    - readwriteonce\n  hostpath:\n    path: \/var\/lib\/mysqlyaml\/mysqlvolume<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>persistentvolumeclaim yaml\uff1a<\/strong><\/p>\n<pre>apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: mysql-pvc\nspec:\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: 10Gi<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fKubernetes \u90e8\u7f72 MySQL 5.7 \u9047\u5230 CrashLoopBackOff \u9519\u8bef\uff1a\u5982\u4f55\u6392\u67e5 d fled while attempting to check config \u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>kubernetes \u90e8\u7f72 5.7 \u62a5\u9519 crashloopbackoff \u95ee\u9898\uff1a \u5728 kubernetes \u96c6\u7fa4\u4e2d\u90e8\u7f72 mysql 5.7 \u65f6\uff0cpod \u5904\u4e8e crashloopbackoff \u72b6\u6001\uff0c\u5e76\u8f93\u51fa\u9519\u8bef\u6d88\u606f\uff1amysqld fled while attempting to check config\u3002 \u539f\u56e0\uff1a \u68c0\u67e5\u914d\u7f6e\u65f6\u51fa\u9519\uff0c\u53ef\u80fd\u662f\u914d\u7f6e\u6587\u4ef6\u6709\u8bef\u6240\u81f4\u3002 \u89e3\u51b3\u65b9\u6cd5\uff1a \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\uff1a \u67e5\u770b mysqld.cnf \u6587\u4ef6\uff0c\u786e\u4fdd\u914d\u7f6e\u6b63\u786e\u65e0\u8bef\u3002 \u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u3002 \u68c0\u67e5\u542f\u52a8\u811a\u672c\uff1a \u786e\u8ba4 \/usr\/bin\/mysql_entrypoint \u811a\u672c\u7684\u5185\u5bb9\u6b63\u786e\u3002 \u786e\u4fdd\u811a\u672c\u80fd\u591f\u6b63\u786e\u6267\u884c mysql_install_db \u547d\u4ee4\u3002 \u68c0\u67e5\u5bb9\u5668\u73af\u5883\uff1a \u786e\u4fdd\u5bb9\u5668\u4e2d\u5b89\u88c5\u4e86\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\u3002 \u786e\u4fdd\u5bb9\u5668\u4e2d\u7684\u7528\u6237\u5177\u6709\u9002\u5f53\u7684\u6743\u9650\u3002 \u68c0\u67e5\u5b58\u50a8\u5377\uff1a \u786e\u4fdd\u5206\u914d\u7ed9 mysql \u6301\u4e45\u5377\u7684\u5b58\u50a8\u7a7a\u95f4\u8db3\u591f\u3002 \u786e\u4fdd\u5377\u7684\u8bbf\u95ee\u6a21\u5f0f\u4e0e\u5bb9\u5668\u914d\u7f6e\u76f8\u5339\u914d\u3002 \u91cd\u65b0\u90e8\u7f72 pod\uff1a \u5220\u9664\u62a5\u9519\u7684 pod\u3002 \u91cd\u65b0\u521b\u5efa pod\uff0c\u786e\u4fdd\u66f4\u65b0\u4e86\u4fee\u590d\u540e\u7684\u914d\u7f6e\u3002 \u4ee5\u4e0b\u662f\u90e8\u5206\u6d89\u53ca\u7684\u6587\u4ef6\u793a\u4f8b\uff1a deployment yaml\uff1a apiversion: apps\/v1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27699","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27699"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27699\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}