{"id":115949,"date":"2026-10-20T15:17:12","date_gmt":"2026-10-20T07:17:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/115949.html"},"modified":"2026-10-20T15:17:12","modified_gmt":"2026-10-20T07:17:12","slug":"prometheus%e5%b7%b2%e7%bb%8f%e8%83%bd%e7%9b%91%e6%8e%a7%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%98%e6%98%af%e7%9c%8b%e4%b8%8d%e5%88%b0mysql%e7%8a%b6%e6%80%81%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/115949.html","title":{"rendered":"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<h2>Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668&#xff0c;\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001&#xff1f;\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86<\/h2>\n<h3>\u524d\u8a00<\/h3>\n<p>Prometheus\u5df2\u7ecf\u80fd\u770b\u670d\u52a1\u5668CPU\u3001\u5185\u5b58&#xff0c;\u4e0d\u4ee3\u8868\u5b83\u5929\u7136\u5c31\u77e5\u9053MySQL\u73b0\u5728\u6709\u591a\u5c11\u8fde\u63a5\u3001\u6162\u67e5\u8be2\u6709\u6ca1\u6709\u7a81\u589e\u3001\u4e3b\u4ece\u590d\u5236\u662f\u4e0d\u662f\u5f02\u5e38\u3002\u6570\u636e\u5e93\u5185\u90e8\u8fd9\u4e9b\u72b6\u6001&#xff0c;\u9700\u8981\u6709\u4eba\u5148\u628a\u5b83\u4eec\u8f6c\u6362\u6210Prometheus\u80fd\u6293\u53d6\u7684\u6307\u6807&#xff0c;\u8fd9\u6b63\u662fmysqld_exporter\u5728\u6574\u6761\u94fe\u8def\u91cc\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>\u8fd9\u6b21\u6211\u5728CentOS 7\u4e0a\u628a\u8fd9\u6761\u94fe\u4ece\u5934\u8d70\u4e86\u4e00\u904d&#xff1a;\u5148\u4e0b\u8f7d\u5e76\u542f\u52a8mysqld_exporter&#xff0c;\u8ba9\u5b83\u901a\u8fc79105\u66b4\u9732\u6307\u6807&#xff1b;\u518d\u628aPrometheus\u6307\u5411\u8fd9\u4e2a\u7aef\u70b9&#xff0c;\u786e\u8ba4Target\u80fd\u591f\u6b63\u5e38\u6293\u53d6&#xff1b;\u968f\u540e\u52a0\u5165MySQL\u5b95\u673a\u3001\u590d\u5236\u5f02\u5e38\u3001\u8fde\u63a5\u6570\u8fc7\u9ad8\u3001\u6162\u67e5\u8be2\u7b49\u544a\u8b66\u89c4\u5219&#xff0c;\u5e76\u5b9e\u9645\u9a8c\u8bc1MySQL\u505c\u6b62\u540e\u544a\u8b66\u51fa\u73b0\u3001\u6062\u590d\u540e\u72b6\u6001\u56de\u5f52\u3002<\/p>\n<p>\u540e\u534a\u90e8\u5206\u518d\u5904\u7406\u4e00\u4e2a\u66f4\u73b0\u5b9e\u7684\u95ee\u9898&#xff1a;\u5982\u679cPrometheus\u548cMySQL\u4e0d\u5728\u540c\u4e00\u5c40\u57df\u7f51&#xff0c;\u600e\u6837\u8ba9\u8fdc\u7aefPrometheus\u7ee7\u7eed\u6293\u52309105\u6307\u6807\u3002\u8fd9\u91cc\u4f1a\u5148\u9a8c\u8bc1\u968f\u673a\u516c\u7f51\u5730\u5740&#xff0c;\u518d\u914d\u7f6e\u56fa\u5b9a\u4e8c\u7ea7\u5b50\u57df\u540d\u3002<\/p>\n<p>\u4e0d\u8fc7\u8fd9\u7bc7\u914d\u7f6e\u91cc\u6709\u51e0\u5904\u4e0d\u80fd\u673a\u68b0\u7167\u6284&#xff1a;\u6388\u6743\u7528\u6237\u5199\u7684\u662fmysqld_exporter&#xff0c;\u5ba2\u6237\u7aef\u914d\u7f6e\u5374\u5199\u6210exporter&#xff1b;systemd\u8def\u5f84\u548c\u624b\u52a8\u542f\u52a8\u8def\u5f84\u4e5f\u5206\u522b\u7528\u4e86mysqld_exporter\u4e0emysql_exporter\u3002\u8fd9\u4e9b\u4ee3\u7801\u6211\u4f1a\u539f\u6837\u4fdd\u7559&#xff0c;\u4f46\u628a\u98ce\u9669\u4f4d\u7f6e\u660e\u786e\u6307\u51fa\u3002<\/p>\n<p>\u5bf9\u6211\u6765\u8bf4&#xff0c;\u8fd9\u7c7b\u76d1\u63a7\u6700\u91cd\u8981\u7684\u4e0d\u662f\u201c\u591a\u4e00\u4e2a\u9875\u9762\u201d&#xff0c;\u800c\u662f\u51fa\u4e86\u95ee\u9898\u4ee5\u540e\u80fd\u4e0d\u80fd\u9a6c\u4e0a\u77e5\u9053\u95ee\u9898\u5728\u54ea\u4e00\u5c42&#xff1a;\u662fMySQL\u672c\u8eab\u6ca1\u542f\u52a8\u3001\u8fde\u63a5\u6570\u63a5\u8fd1\u4e0a\u9650\u3001\u590d\u5236\u5ef6\u8fdf&#xff0c;\u8fd8\u662fexporter\u6839\u672c\u6ca1\u6709\u91c7\u96c6\u6210\u529f\u3002\u628a\u8fd9\u51e0\u4e2a\u73af\u8282\u62c6\u5f00\u9a8c\u8bc1&#xff0c;\u540e\u9762\u7684\u6392\u969c\u4f1a\u6bd4\u53ea\u770b\u65e5\u5fd7\u6e05\u695a\u5f88\u591a\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad715722041a.png\" alt=\"image-20251124142636252\" \/><\/p>\n<h3>1 \u5148\u628aMySQL\u76d1\u63a7\u94fe\u8def\u7684\u89d2\u8272\u5206\u6e05<\/h3>\n<p>\u8fd9\u7bc7\u6700\u91cd\u8981\u7684\u4e0d\u662f\u8bb0\u547d\u4ee4&#xff0c;\u800c\u662f\u5148\u770b\u61c2\u56db\u5c42\u5173\u7cfb&#xff1a;<\/p>\n<p>MySQL \u2192 mysqld_exporter \u2192 Prometheus \u2192 \u544a\u8b66\u89c4\u5219<\/p>\n<p>MySQL \u672c\u8eab\u63d0\u4f9b\u8fd0\u884c\u72b6\u6001\u3002<\/p>\n<p>mysqld_exporter \u8d1f\u8d23\u8bfb\u53d6\u8fd9\u4e9b\u72b6\u6001&#xff0c;\u5e76\u8f6c\u6362\u6210 Prometheus \u80fd\u6293\u53d6\u7684\u6307\u6807\u3002<\/p>\n<p>Prometheus \u518d\u5b9a\u671f\u6293\u53d6 9105&#xff0c;\u628a\u6307\u6807\u4fdd\u5b58\u4e0b\u6765\u5e76\u7528\u4e8e\u67e5\u8be2\u3001\u89c4\u5219\u8bc4\u4f30\u548c\u544a\u8b66\u5224\u65ad\u3002<\/p>\n<p>\u6240\u4ee5 mysqld_exporter \u66f4\u50cf\u4e00\u5ea7\u6865\u3002<\/p>\n<p>\u6ca1\u6709\u8fd9\u5ea7\u6865&#xff0c;Prometheus \u5e76\u4e0d\u4f1a\u51ed\u7a7a\u77e5\u9053 MySQL \u5185\u90e8\u7684\u8fde\u63a5\u6570\u3001\u590d\u5236\u72b6\u6001\u548c\u6162\u67e5\u8be2\u60c5\u51b5\u3002<\/p>\n<h3>2 \u4e0b\u8f7dmysqld_exporter<\/h3>\n<p>\u5728 Prometheus \u76f8\u5173\u4e0b\u8f7d\u9875\u9762\u83b7\u53d6 Linux \u7248\u672c&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad715725e757.png\" alt=\"image-20251124150101916\" \/><\/p>\n<p>\u4e0b\u8f7d\u540e\u4e0a\u4f20\u5230 \/app&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad7157292a45.png\" alt=\"image-20251124150459790\" \/><\/p>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4&#xff1a;<\/p>\n<p><span class=\"token function\">wget<\/span><br \/>\nhttps:\/\/github.com\/prometheus\/mysqld_exporter\/releases\/download\/v0.18.0\/mysqld_exporter-0.18.0.linux-amd64.tar.gz<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u7ec6\u8282\u503c\u5f97\u6ce8\u610f\u3002<\/p>\n<p>\u4ee3\u7801\u5757\u628a&#xff1a;<\/p>\n<p>wget<\/p>\n<p>\u548c\u4e0b\u8f7d URL \u5206\u6210\u4e86\u4e24\u884c\u3002<\/p>\n<p>\u5982\u679c\u7ec8\u7aef\u76f4\u63a5\u9010\u884c\u6267\u884c&#xff0c;\u7b2c\u4e00\u884c\u53ea\u4f1a\u6267\u884c\u4e00\u4e2a\u4e0d\u5e26\u53c2\u6570\u7684 wget\u3002<\/p>\n<p>\u771f\u6b63\u6267\u884c\u65f6\u5e94\u8be5\u5148\u786e\u8ba4\u547d\u4ee4\u683c\u5f0f&#xff0c;\u800c\u4e0d\u662f\u673a\u68b0\u590d\u5236\u3002<\/p>\n<h3>3 \u89e3\u538b\u5e76\u6574\u7406\u76ee\u5f55<\/h3>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-zxvf<\/span> mysqld_exporter-0.18.0.linux-amd64.tar.gz<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad71572a1f33.png\" alt=\"image-20251124150544662\" \/><\/p>\n<p>\u7136\u540e\u6539\u540d&#xff1a;<\/p>\n<p><span class=\"token function\">mv<\/span> mysqld_exporter-0.18.0.linux-amd64\/ mysqld_exporter<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad71572b3782.png\" alt=\"image-20251124152121251\" \/><\/p>\n<p>\u6700\u7ec8\u76ee\u5f55\u662f&#xff1a;<\/p>\n<p>\/app\/mysqld_exporter<\/p>\n<p>\u540e\u9762\u7684 systemd \u914d\u7f6e\u4e5f\u4f1a\u7528\u5230\u8fd9\u4e2a\u8def\u5f84\u3002<\/p>\n<h3>4 \u7ed9\u76d1\u63a7\u5355\u72ec\u521b\u5efaMySQL\u8d26\u53f7<\/h3>\n<p>\u5728 MySQL \u4e2d\u6267\u884c&#xff1a;<\/p>\n<p>GRANT REPLICATION CLIENT, PROCESS ON *.* TO <span class=\"token string\">&#039;mysqld_exporter&#039;<\/span>&#064;<span class=\"token string\">&#039;localhost&#039;<\/span> identified by <span class=\"token string\">&#039;12345678&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\nGRANT SELECT ON performance_schema.* TO <span class=\"token string\">&#039;mysqld_exporter&#039;<\/span>&#064;<span class=\"token string\">&#039;localhost&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\nflush privileges<span class=\"token punctuation\">;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad71572c0aba.png\" alt=\"image-20251124173648818\" \/><\/p>\n<p>\u8fd9\u91cc\u521b\u5efa\u7684\u662f&#xff1a;<\/p>\n<p>mysqld_exporter&#064;localhost<\/p>\n<p>\u5e76\u6388\u4e88&#xff1a;<\/p>\n<ul>\n<li>REPLICATION CLIENT<\/li>\n<li>PROCESS<\/li>\n<li>performance_schema.* \u7684 SELECT<\/li>\n<\/ul>\n<p>\u8fd9\u6bd4\u76f4\u63a5\u7528 root \u8d26\u53f7\u7ed9 exporter \u8fde\u63a5\u6570\u636e\u5e93\u66f4\u5408\u7406\u3002<\/p>\n<p>\u76d1\u63a7\u8d26\u53f7\u53ea\u62ff\u91c7\u96c6\u6307\u6807\u9700\u8981\u7684\u6743\u9650&#xff0c;\u957f\u671f\u7ef4\u62a4\u4e5f\u66f4\u5bb9\u6613\u63a7\u5236\u3002<\/p>\n<h3>5 \u5ba2\u6237\u7aef\u914d\u7f6e\u91cc\u7684\u7528\u6237\u540d\u548c\u524d\u9762\u4e0d\u4e00\u81f4<\/h3>\n<p>\u63a5\u4e0b\u6765\u914d\u7f6e\u6587\u4ef6\u5199\u7684\u662f&#xff1a;<\/p>\n<p><span class=\"token punctuation\">[<\/span>client<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">user<\/span><span class=\"token operator\">&#061;<\/span>exporter<br \/>\n<span class=\"token assign-left variable\">password<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">12345678<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad71572eeea5.png\" alt=\"image-20251124164410692\" \/><\/p>\n<p>\u8fd9\u91cc\u7528\u6237\u540d\u53d8\u6210\u4e86&#xff1a;<\/p>\n<p>exporter<\/p>\n<p>\u800c\u524d\u9762\u771f\u6b63\u6388\u6743\u7684\u662f&#xff1a;<\/p>\n<p>mysqld_exporter<\/p>\n<p>\u8fd9\u4e24\u8005\u5e76\u4e0d\u4e00\u81f4\u3002<\/p>\n<p>\u5982\u679c\u6570\u636e\u5e93\u91cc\u6ca1\u6709\u989d\u5916\u521b\u5efa exporter \u7528\u6237&#xff0c;\u90a3\u4e48 exporter \u542f\u52a8\u4ee5\u540e\u5f88\u53ef\u80fd\u56e0\u4e3a\u8ba4\u8bc1\u5931\u8d25\u800c\u65e0\u6cd5\u91c7\u96c6\u3002<\/p>\n<p>\u6240\u4ee5\u771f\u6b63\u6267\u884c\u65f6&#xff0c;\u5fc5\u987b\u8ba9&#xff1a;<\/p>\n<p>MySQL\u521b\u5efa\u7684\u7528\u6237\u540d<\/p>\n<p>\u548c&#xff1a;<\/p>\n<p>\u5ba2\u6237\u7aef\u914d\u7f6e\u4e2d\u7684 user<\/p>\n<p>\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<p>\u4ee3\u7801\u5757\u6309\u7167\u5df2\u6709\u64cd\u4f5c\u539f\u6837\u4fdd\u7559&#xff0c;\u4e0d\u5728\u8fd9\u91cc\u5077\u5077\u66ff\u6362\u3002<\/p>\n<h3>6 \u521b\u5efamysqld_exporter systemd\u670d\u52a1<\/h3>\n<p>\u670d\u52a1\u914d\u7f6e&#xff1a;<\/p>\n<p><span class=\"token punctuation\">[<\/span>Unit<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">Description<\/span><span class=\"token operator\">&#061;<\/span>exporter<br \/>\n<span class=\"token assign-left variable\">After<\/span><span class=\"token operator\">&#061;<\/span>network.target<br \/>\n<span class=\"token punctuation\">[<\/span>Service<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">Type<\/span><span class=\"token operator\">&#061;<\/span>simple<br \/>\n<span class=\"token assign-left variable\">User<\/span><span class=\"token operator\">&#061;<\/span>prometheus<br \/>\n<span class=\"token assign-left variable\">ExecStart<\/span><span class=\"token operator\">&#061;<\/span>\/app\/mysqld_exporter\/mysqld_exporter &#8211;config.my-cnf<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/app\/mysqld_exporter\/localhost_db.cnf&#034;<\/span> &#8211;web.listen-address<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;:9105&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">Restart<\/span><span class=\"token operator\">&#061;<\/span>on-failure<br \/>\n<span class=\"token punctuation\">[<\/span>Install<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">WantedBy<\/span><span class=\"token operator\">&#061;<\/span>multi-user.target<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071707-6ad715730bb7e.png\" alt=\"\" \/><\/p>\n<p>\u8fd9\u91cc\u6709\u4e09\u4e2a\u5173\u952e\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u8fd0\u884c\u7528\u6237&#xff1a;prometheus<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6&#xff1a;\/app\/mysqld_exporter\/localhost_db.cnf<\/li>\n<li>\u76d1\u542c\u5730\u5740&#xff1a;:9105<\/li>\n<\/ul>\n<p>\u56e0\u6b64\u5982\u679c\u540e\u9762\u670d\u52a1\u542f\u52a8\u5931\u8d25&#xff0c;\u4f18\u5148\u68c0\u67e5&#xff1a;<\/p>\n<li>\u7cfb\u7edf\u91cc\u662f\u5426\u771f\u7684\u5b58\u5728 prometheus \u7528\u6237&#xff1b;<\/li>\n<li>\/app\/mysqld_exporter\/mysqld_exporter \u662f\u5426\u5b58\u5728&#xff1b;<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u662f\u5426\u6b63\u786e&#xff1b;<\/li>\n<li>prometheus \u7528\u6237\u662f\u5426\u6709\u8bfb\u53d6\u6743\u9650\u3002<\/li>\n<h3>7 \u624b\u52a8\u542f\u52a8\u547d\u4ee4\u53c8\u51fa\u73b0\u4e86\u53e6\u4e00\u5957\u76ee\u5f55\u540d<\/h3>\n<p>\u624b\u52a8\u65b9\u5f0f\u662f&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-u<\/span> prometheus \/app\/mysql_exporter\/mysqld_exporter   &#8211;config.my-cnf<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/app\/mysql_exporter\/localhost_db.cnf&#034;<\/span>   &#8211;web.listen-address<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;:9105&#034;<\/span><\/p>\n<p>\u8fd9\u91cc\u4f7f\u7528\u7684\u662f&#xff1a;<\/p>\n<p>\/app\/mysql_exporter\/<\/p>\n<p>\u800c\u524d\u9762\u5b9e\u9645\u6539\u540d\u540e\u7684\u76ee\u5f55\u662f&#xff1a;<\/p>\n<p>\/app\/mysqld_exporter\/<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff1a;<\/p>\n<p>mysqld_exporter<\/p>\n<p>\u548c&#xff1a;<\/p>\n<p>mysql_exporter<\/p>\n<p>\u5728\u8def\u5f84\u91cc\u6df7\u7528\u4e86\u3002<\/p>\n<p>\u8fd9\u4e0d\u662f\u5355\u7eaf\u7684\u5199\u6cd5\u5dee\u5f02&#xff0c;\u800c\u4f1a\u76f4\u63a5\u5f71\u54cd\u547d\u4ee4\u80fd\u4e0d\u80fd\u627e\u5230\u6587\u4ef6\u3002<\/p>\n<p>\u5982\u679c systemd \u65b9\u5f0f\u80fd\u542f\u52a8&#xff0c;\u4f46\u624b\u52a8\u65b9\u5f0f\u62a5\u201c\u6587\u4ef6\u4e0d\u5b58\u5728\u201d&#xff0c;\u5e94\u8be5\u5148\u6838\u5bf9\u8fd9\u4e2a\u8def\u5f84\u3002<\/p>\n<h3>8 \u5148\u786e\u8ba49105\u6307\u6807\u9875\u9762\u80fd\u6253\u5f00<\/h3>\n<p>\u6d4f\u89c8\u5668\u901a\u8fc7\u670d\u52a1\u5668 IP \u52a0 9105 \u8bbf\u95ee&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071707-6ad715732ac13.png\" alt=\"image-20251124175742970\" \/><\/p>\n<p>\u8fd9\u4e00\u6b65\u80fd\u8bc1\u660e\u7684\u662f&#xff1a;<\/p>\n<p>mysqld_exporter\u8fdb\u7a0b\u5df2\u7ecf\u76d1\u542c9105&#xff0c;\u5e76\u4e14Web\u7aef\u70b9\u53ef\u8bbf\u95ee\u3002<\/p>\n<p>\u5982\u679c\u8fd9\u4e00\u6b65\u5931\u8d25&#xff0c;\u5c31\u4e0d\u8981\u6025\u7740\u53bb\u6539 Prometheus\u3002<\/p>\n<p>\u5148\u628a exporter \u81ea\u8eab\u8dd1\u901a\u3002<\/p>\n<h3>9 \u518d\u628aPrometheus\u6307\u54119105<\/h3>\n<p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">vi<\/span> prometheus.yml<\/p>\n<p>\u52a0\u5165\u76ee\u6807&#xff1a;<\/p>\n<p>      &#8211; targets: <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;localhost:9105&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        labels:<br \/>\n          app: <span class=\"token string\">&#034;mysql_exporter&#034;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071707-6ad71573c7dc2.png\" alt=\"image-20251125104102393\" \/><\/p>\n<p>\u7136\u540e\u91cd\u542f Prometheus&#xff1a;<\/p>\n<p>systemctl restart prometheus<\/p>\n<p>\u6253\u5f00 Prometheus 9090&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071707-6ad71573e6f29.png\" alt=\"image-20251125103926501\" \/><\/p>\n<p>Target \u88ab\u68c0\u6d4b\u5230&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071708-6ad715746b34c.png\" alt=\"image-20251125104153997\" \/><\/p>\n<p>\u505a\u5230\u8fd9\u91cc&#xff0c;\u624d\u7b97\u771f\u6b63\u6253\u901a&#xff1a;<\/p>\n<p>MySQL \u2192 mysqld_exporter:9105 \u2192 Prometheus<\/p>\n<h3>10 \u8fd9\u6bb5Target\u914d\u7f6e\u53ea\u662f\u5c40\u90e8\u7247\u6bb5<\/h3>\n<p>\u793a\u4f8b\u91cc\u53ea\u5c55\u793a\u4e86&#xff1a;<\/p>\n<p>targets<\/p>\n<p>\u548c&#xff1a;<\/p>\n<p>labels<\/p>\n<p>\u4f46\u6ca1\u6709\u628a\u5b8c\u6574\u7684 scrape_configs\u3001job_name \u4e00\u8d77\u5c55\u793a\u3002<\/p>\n<p>\u6240\u4ee5\u5982\u679c\u76f4\u63a5\u628a\u8fd9\u4e24\u884c\u7c98\u8d34\u5230 prometheus.yml \u4efb\u610f\u4f4d\u7f6e&#xff0c;\u914d\u7f6e\u672a\u5fc5\u6709\u6548\u3002<\/p>\n<p>\u771f\u6b63\u6267\u884c\u65f6&#xff0c;\u5e94\u8be5\u786e\u8ba4\u5b83\u4f4d\u4e8e\u6b63\u786e\u7684 scrape job \u4e0b\u9762\u3002<\/p>\n<p>\u8fd9\u7bc7\u4fdd\u7559\u73b0\u6709\u7247\u6bb5&#xff0c;\u4f46\u4e0d\u628a\u5b83\u63cf\u8ff0\u6210\u53ef\u4ee5\u8131\u79bb\u4e0a\u4e0b\u6587\u76f4\u63a5\u590d\u5236\u7684\u5b8c\u6574\u914d\u7f6e\u3002<\/p>\n<h3>11 \u52a0\u5165MySQL\u544a\u8b66\u89c4\u5219<\/h3>\n<p>\u793a\u4f8b\u89c4\u5219\u5982\u4e0b&#xff1a;<\/p>\n<p>groups:<br \/>\n&#8211; name: mysql-alerts<br \/>\n  rules:<\/p>\n<p>  <span class=\"token comment\"># 1. MySQL \u5b9e\u4f8b\u5b95\u673a\u6216 exporter \u65e0\u6cd5\u91c7\u96c6<\/span><br \/>\n  &#8211; alert: MySQLDown<br \/>\n    expr: mysql_up <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span><br \/>\n    for: 1m<br \/>\n    labels:<br \/>\n      severity: critical<br \/>\n    annotations:<br \/>\n      summary: <span class=\"token string\">&#034;MySQL instance down&#034;<\/span><br \/>\n      description: <span class=\"token string\">&#034;MySQL instance {{ <span class=\"token variable\">$labels<\/span>.instance }} has been down for more than 1 minute.&#034;<\/span><\/p>\n<p>  <span class=\"token comment\"># 2. \u4e3b\u4ece\u590d\u5236\u4e2d\u65ad&#xff08;\u4ec5\u9002\u7528\u4e8e\u6709\u4ece\u5e93\u7684\u573a\u666f&#xff09;<\/span><br \/>\n  &#8211; alert: MySQLReplicationBroken<br \/>\n    expr: mysql_slave_status_seconds_behind_master <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">300<\/span><br \/>\n    for: 2m<br \/>\n    labels:<br \/>\n      severity: warning<br \/>\n    annotations:<br \/>\n      summary: <span class=\"token string\">&#034;MySQL replication lag&#034;<\/span><br \/>\n      description: <span class=\"token string\">&#034;MySQL replication on {{ <span class=\"token variable\">$labels<\/span>.instance }} is lagging by {{ <span class=\"token variable\">$value<\/span> }} seconds.&#034;<\/span><\/p>\n<p>  <span class=\"token comment\"># 3. \u4e3b\u4ece IO\/SQL \u7ebf\u7a0b\u505c\u6b62<\/span><br \/>\n  &#8211; alert: MySQLReplicationIOThreadDown<br \/>\n    expr: mysql_slave_status_master_server_id <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span> and mysql_slave_status_slave_io_running <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span><br \/>\n    for: 1m<br \/>\n    labels:<br \/>\n      severity: critical<br \/>\n    annotations:<br \/>\n      summary: <span class=\"token string\">&#034;MySQL replication IO thread stopped&#034;<\/span><br \/>\n      description: <span class=\"token string\">&#034;Slave IO thread is not running on {{ <span class=\"token variable\">$labels<\/span>.instance }}.&#034;<\/span><\/p>\n<p>  &#8211; alert: MySQLReplicationSQLThreadDown<br \/>\n    expr: mysql_slave_status_master_server_id <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span> and mysql_slave_status_slave_sql_running <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span><br \/>\n    for: 1m<br \/>\n    labels:<br \/>\n      severity: critical<br \/>\n    annotations:<br \/>\n      summary: <span class=\"token string\">&#034;MySQL replication SQL thread stopped&#034;<\/span><br \/>\n      description: <span class=\"token string\">&#034;Slave SQL thread is not running on {{ <span class=\"token variable\">$labels<\/span>.instance }}.&#034;<\/span><\/p>\n<p>  <span class=\"token comment\"># 4. \u8fde\u63a5\u6570\u4f7f\u7528\u7387\u8fc7\u9ad8&#xff08;\u8d85\u8fc7 80%&#xff09;<\/span><br \/>\n  &#8211; alert: MySQLTooManyConnections<br \/>\n    expr: <span class=\"token punctuation\">(<\/span>mysql_global_status_threads_connected \/ mysql_global_variables_max_connections<span class=\"token punctuation\">)<\/span> * <span class=\"token number\">100<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">80<\/span><br \/>\n    for: 2m<br \/>\n    labels:<br \/>\n      severity: warning<br \/>\n    annotations:<br \/>\n      summary: <span class=\"token string\">&#034;High MySQL connection usage&#034;<\/span><br \/>\n      description: <span class=\"token string\">&#034;{{ <span class=\"token variable\">$labels<\/span>.instance }}: MySQL connection usage is {{ <span class=\"token variable\">$value<\/span> | printf <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>%.2f<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span> }}% of max_connections.&#034;<\/span><\/p>\n<p>  <span class=\"token comment\"># 5. \u6162\u67e5\u8be2\u6570\u91cf\u7a81\u589e&#xff08;\u8fc7\u53bb5\u5206\u949f\u6162\u67e5\u8be2 &gt; 10 \u6761&#xff09;<\/span><br \/>\n  &#8211; alert: MySQLHighSlowQueries<br \/>\n    expr: rate<span class=\"token punctuation\">(<\/span>mysql_global_status_slow_queries<span class=\"token punctuation\">[<\/span>5m<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0.1<\/span>  <span class=\"token comment\"># \u2248 \u6bcf\u5206\u949f &gt; 6 \u6761<\/span><br \/>\n    for: 5m<br \/>\n    labels:<br \/>\n      severity: warning<br \/>\n    annotations:<br \/>\n      summary: <span class=\"token string\">&#034;High rate of slow queries on MySQL&#034;<\/span><br \/>\n      description: <span class=\"token string\">&#034;{{ <span class=\"token variable\">$labels<\/span>.instance }}: Slow query rate is {{ <span class=\"token variable\">$value<\/span> | printf <span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>%.2f<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span> }} per second.&#034;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071708-6ad71574a1284.png\" alt=\"image-20251125112832127\" \/><\/p>\n<p>\u8fd9\u7ec4\u89c4\u5219\u8986\u76d6\u4e86\u51e0\u7c7b\u5e38\u89c1\u6570\u636e\u5e93\u72b6\u6001&#xff1a;<\/p>\n<ul>\n<li>MySQL \u5b9e\u4f8b\u4e0d\u53ef\u7528&#xff1b;<\/li>\n<li>\u4e3b\u4ece\u590d\u5236\u5ef6\u8fdf&#xff1b;<\/li>\n<li>\u4e3b\u4ece IO \u7ebf\u7a0b\u505c\u6b62&#xff1b;<\/li>\n<li>\u4e3b\u4ece SQL \u7ebf\u7a0b\u505c\u6b62&#xff1b;<\/li>\n<li>\u8fde\u63a5\u6570\u4f7f\u7528\u7387\u8fc7\u9ad8&#xff1b;<\/li>\n<li>\u6162\u67e5\u8be2\u901f\u7387\u5347\u9ad8\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u89c4\u5219\u7684\u610f\u4e49\u662f&#xff1a;<\/p>\n<p>Prometheus\u5df2\u7ecf\u4e0d\u53ea\u662f\u201c\u91c7\u96c6\u201d&#xff0c;\u5f00\u59cb\u5bf9\u6307\u6807\u505a\u6761\u4ef6\u5224\u65ad\u3002<\/p>\n<h3>12 \u89c4\u5219\u6587\u4ef6\u52a0\u5165Prometheus<\/h3>\n<p>\u8fdb\u5165\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">vi<\/span> prometheus.yml<\/p>\n<p>\u628a\u89c4\u5219\u6587\u4ef6\u52a0\u5165&#xff1a;<\/p>\n<p>rule_files:<br \/>\n  &#8211;  <span class=\"token string\">&#034;\/app\/prometheus\/1.yml&#034;<\/span><br \/>\n  &#8211;  <span class=\"token string\">&#034;\/app\/prometheus\/2.yml&#034;<\/span><br \/>\n  &#8211;  <span class=\"token string\">&#034;\/app\/prometheus\/3.yml&#034;<\/span><br \/>\n  &#8211;  <span class=\"token string\">&#034;\/app\/prometheus\/4.yml&#034;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071708-6ad71574f3639.png\" alt=\"image-20251125113103946\" \/><\/p>\n<p>\u7136\u540e\u91cd\u542f&#xff1a;<\/p>\n<p>systemctl restart prometheus<\/p>\n<p>\u518d\u6b21\u6253\u5f00 Prometheus&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071709-6ad715751168e.png\" alt=\"image-20251125103926501\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u544a\u8b66\u89c4\u5219&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071709-6ad7157589aff.png\" alt=\"image-20251125134824200\" \/><\/p>\n<h3>13 \u8fd9\u7bc7\u5b9e\u9645\u9a8c\u8bc1\u4e86MySQLDown\u544a\u8b66<\/h3>\n<p>\u6b64\u65f6 MySQL \u6ca1\u6709\u542f\u52a8&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071710-6ad715763cad1.png\" alt=\"image-20251125134912322\" \/><\/p>\n<p>\u6240\u4ee5\u544a\u8b66\u8fdb\u5165\u5f02\u5e38\u72b6\u6001\u3002<\/p>\n<p>\u968f\u540e\u91cd\u65b0\u542f\u52a8 MySQL&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071710-6ad71576c1683.png\" alt=\"image-20251125140748166\" \/><\/p>\n<p>\u72b6\u6001\u6062\u590d\u3002<\/p>\n<p>\u8fd9\u6bb5\u9a8c\u8bc1\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<p>\u56e0\u4e3a\u5b83\u4e0d\u53ea\u662f\u201c\u89c4\u5219\u5199\u8fdb\u53bb\u4e86\u201d&#xff0c;\u800c\u662f\u5b9e\u9645\u8bc1\u660e&#xff1a;<\/p>\n<p>MySQL\u72b6\u6001\u53d8\u5316 \u2192 exporter\u6307\u6807\u53d8\u5316 \u2192 Prometheus\u89c4\u5219\u72b6\u6001\u53d8\u5316<\/p>\n<p>\u8fd9\u6761\u94fe\u5df2\u7ecf\u5de5\u4f5c\u3002<\/p>\n<h3>14 \u4f46\u8fd9\u8fd8\u4e0d\u7b49\u4e8eAlertmanager\u901a\u77e5\u5df2\u7ecf\u5b8c\u6210<\/h3>\n<p>\u7ae0\u8282\u6807\u9898\u5199\u7684\u662f&#xff1a;<\/p>\n<p>\u201c\u4f7f\u7528alertmanager\u914d\u7f6emysql_exporter\u544a\u8b66\u201d\u3002<\/p>\n<p>\u4f46\u6b63\u6587\u8fd9\u4e00\u6bb5\u5b9e\u9645\u5c55\u793a\u7684\u662f&#xff1a;<\/p>\n<ul>\n<li>Prometheus rule \u6587\u4ef6&#xff1b;<\/li>\n<li>Prometheus \u91cd\u542f&#xff1b;<\/li>\n<li>Prometheus Alerts \u9875\u9762&#xff1b;<\/li>\n<li>MySQL\u505c\u6b62\u4e0e\u6062\u590d\u3002<\/li>\n<\/ul>\n<p>\u6ca1\u6709\u7ee7\u7eed\u5c55\u793a&#xff1a;<\/p>\n<ul>\n<li>Alertmanager receiver&#xff1b;<\/li>\n<li>\u90ae\u4ef6&#xff1b;<\/li>\n<li>Webhook&#xff1b;<\/li>\n<li>\u4f01\u4e1a\u5fae\u4fe1&#xff1b;<\/li>\n<li>Slack&#xff1b;<\/li>\n<li>\u5176\u4ed6\u6d88\u606f\u901a\u77e5\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5\u66f4\u51c6\u786e\u7684\u8bf4\u6cd5\u5e94\u8be5\u662f&#xff1a;<\/p>\n<p>Prometheus\u544a\u8b66\u89c4\u5219\u5df2\u7ecf\u914d\u7f6e\u5e76\u89e6\u53d1\u3002<\/p>\n<p>\u5982\u679c\u524d\u9762\u5df2\u7ecf\u53e6\u5916\u90e8\u7f72\u5e76\u63a5\u5165 Alertmanager&#xff0c;\u5b83\u53ef\u4ee5\u7ee7\u7eed\u63a5\u6536\u8fd9\u4e9b\u544a\u8b66\u3002<\/p>\n<p>\u4f46\u4ec5\u51ed\u5f53\u524d\u5185\u5bb9&#xff0c;\u8fd8\u4e0d\u80fd\u8bc1\u660e\u901a\u77e5\u6e20\u9053\u5df2\u7ecf\u5b8c\u6574\u8dd1\u901a\u3002<\/p>\n<h3>15 \u4e3b\u4ece\u590d\u5236\u89c4\u5219\u53ea\u9002\u5408\u771f\u6b63\u6709\u4ece\u5e93\u7684\u73af\u5883<\/h3>\n<p>\u8fd9\u7ec4\u89c4\u5219\u91cc\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>mysql_slave_status_seconds_behind_master<\/li>\n<li>mysql_slave_status_slave_io_running<\/li>\n<li>mysql_slave_status_slave_sql_running<\/li>\n<\/ul>\n<p>\u5982\u679c\u5f53\u524d MySQL \u6ca1\u6709\u4e3b\u4ece\u67b6\u6784&#xff0c;\u8fd9\u4e9b\u89c4\u5219\u6ca1\u6709\u5b9e\u9645\u610f\u4e49\u3002<\/p>\n<p>\u6240\u4ee5\u4e0d\u8981\u4e3a\u4e86\u201c\u89c4\u5219\u8d8a\u591a\u8d8a\u5b8c\u6574\u201d\u5168\u90e8\u7167\u642c\u3002<\/p>\n<p>\u66f4\u5408\u7406\u7684\u662f&#xff1a;<\/p>\n<p>\u6309\u81ea\u5df1\u7684\u6570\u636e\u5e93\u67b6\u6784\u9009\u62e9\u89c4\u5219\u3002<\/p>\n<p>\u5355\u673a MySQL \u53ef\u4ee5\u5148\u4fdd\u7559&#xff1a;<\/p>\n<ul>\n<li>MySQLDown<\/li>\n<li>\u8fde\u63a5\u6570<\/li>\n<li>\u6162\u67e5\u8be2<\/li>\n<\/ul>\n<p>\u590d\u5236\u7c7b\u89c4\u5219\u53ea\u5728\u771f\u7684\u5b58\u5728\u4ece\u5e93\u65f6\u4f7f\u7528\u3002<\/p>\n<h3>16 \u672c\u5730\u76d1\u63a7\u8dd1\u901a\u4ee5\u540e&#xff0c;\u518d\u8003\u8651\u5f02\u5730\u6293\u53d6<\/h3>\n<p>\u5230\u8fd9\u91cc&#xff0c;\u5982\u679c MySQL\u3001mysqld_exporter \u548c Prometheus \u90fd\u5728\u540c\u4e00\u4e2a\u7f51\u7edc\u4e2d&#xff0c;\u672c\u5730\u76d1\u63a7\u5df2\u7ecf\u5b8c\u6210\u3002<\/p>\n<p>\u4f46\u5982\u679c&#xff1a;<\/p>\n<ul>\n<li>MySQL \u5728\u670b\u53cb\u670d\u52a1\u5668&#xff1b;<\/li>\n<li>Prometheus \u5728\u53e6\u4e00\u53f0\u673a\u5668&#xff1b;<\/li>\n<li>\u4e24\u8fb9\u4e0d\u5728\u540c\u4e00\u5c40\u57df\u7f51&#xff1b;<\/li>\n<\/ul>\n<p>Prometheus \u5c31\u9700\u8981\u4e00\u4e2a\u80fd\u591f\u8bbf\u95ee\u5230 exporter \u7684\u7f51\u7edc\u5165\u53e3\u3002<\/p>\n<p>\u8fd9\u624d\u662f\u540e\u9762\u516c\u7f51\u90e8\u5206\u7684\u7528\u9014\u3002<\/p>\n<h3>17 \u5b89\u88c5cpolar<\/h3>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">curl<\/span> https:\/\/get.cpolar.sh <span class=\"token operator\">|<\/span> <span class=\"token function\">sh<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071711-6ad7157710bc6.png\" alt=\"image-20250814101639846\" \/><\/p>\n<p>\u5b89\u88c5\u540e\u67e5\u770b\u670d\u52a1&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl status cpolar<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071711-6ad715771e9c0.png\" alt=\"22e5adfaf290a17fc3384bb296055259\" \/><\/p>\n<p>\u7136\u540e\u901a\u8fc7&#xff1a;<\/p>\n<p>\u670d\u52a1\u5668IP:9200<\/p>\n<p>\u8fdb\u5165 Web UI&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20tr3bznhshpz.png\" alt=\"8a6698b1bf26d64ba3645827fbfb1c29\" \/><\/p>\n<h3>18 \u7ed99105\u521b\u5efa\u968f\u673a\u516c\u7f51\u5165\u53e3<\/h3>\n<p>\u521b\u5efa\u96a7\u9053&#xff1a;<\/p>\n<ul>\n<li>\u96a7\u9053\u540d\u79f0&#xff1a;mysql_exporter<\/li>\n<li>\u534f\u8bae&#xff1a;http<\/li>\n<li>\u672c\u5730\u5730\u5740&#xff1a;9105<\/li>\n<li>\u57df\u540d\u7c7b\u578b&#xff1a;\u968f\u673a\u57df\u540d<\/li>\n<li>\u5730\u533a&#xff1a;China Top<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"2026-10-20jh2dq04xfjv.png\" alt=\"image-20251125140431855\" \/><\/p>\n<p>\u521b\u5efa\u4ee5\u540e\u67e5\u770b\u5728\u7ebf\u96a7\u9053&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20irpt1fqxjkq.png\" alt=\"image-20251125140532931\" \/><\/p>\n<p>\u4ece\u5916\u90e8\u8bbf\u95ee&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20jg2t0uxjugk.png\" alt=\"image-20251125140523720\" \/><\/p>\n<p>\u9875\u9762\u80fd\u6253\u5f00\u4ee5\u540e\u8bf4\u660e&#xff1a;<\/p>\n<p>\u5916\u90e8\u6d4f\u89c8\u5668 \u2192 \u516c\u7f51\u5730\u5740 \u2192 cpolar \u2192 9105 \u2192 mysqld_exporter<\/p>\n<p>\u8fd9\u6761\u7f51\u7edc\u94fe\u8def\u5df2\u7ecf\u901a\u4e86\u3002<\/p>\n<h3>19 \u8fdc\u7a0bPrometheus\u518d\u6293\u516c\u7f51\u5730\u5740<\/h3>\n<p>Prometheus \u793a\u4f8b\u914d\u7f6e&#xff1a;<\/p>\n<p>      &#8211; targets: <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;38c53143.r2.cpolar.top&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        labels:<br \/>\n          app: <span class=\"token string\">&#034;mysql_exporter&#034;<\/span><\/p>\n<p><img decoding=\"async\" src=\"2026-10-20voscwluvayh.png\" alt=\"image-20251125140712345\" \/><\/p>\n<p>\u968f\u540e\u663e\u793a\u6293\u53d6\u6210\u529f&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20cjbbmrsb0zz.png\" alt=\"image-20251125140820943\" \/><\/p>\n<p>\u8fd9\u4e00\u6bb5\u8bc1\u660e\u7684\u662f&#xff1a;<\/p>\n<p>\u5f02\u5730 Prometheus \u53ef\u4ee5\u901a\u8fc7\u516c\u7f51\u5730\u5740\u8bbf\u95ee exporter \u6307\u6807\u7aef\u70b9\u3002<\/p>\n<p>\u4f46\u4ecd\u7136\u9700\u8981\u6ce8\u610f&#xff1a;<\/p>\n<p>\u793a\u4f8b target \u53ea\u5199\u4e86\u4e3b\u673a\u540d&#xff0c;\u6ca1\u6709\u5c55\u793a\u5b8c\u6574 job\u3001scheme \u548c\u7aef\u53e3\u4e0a\u4e0b\u6587\u3002<\/p>\n<p>\u6240\u4ee5\u5b83\u4ecd\u7136\u66f4\u50cf\u5c40\u90e8\u914d\u7f6e\u7247\u6bb5&#xff0c;\u800c\u4e0d\u662f\u5b8c\u6574 scrape job\u3002<\/p>\n<h3>20 \u628a9105\u6307\u6807\u7aef\u70b9\u516c\u5f00\u4ee5\u540e\u8981\u6ce8\u610f\u4fe1\u606f\u66b4\u9732<\/h3>\n<p>mysqld_exporter \u7684\u6307\u6807\u9875\u4e0d\u662f\u666e\u901a\u5ba3\u4f20\u9875\u9762\u3002<\/p>\n<p>\u5b83\u53ef\u80fd\u66b4\u9732&#xff1a;<\/p>\n<ul>\n<li>\u6570\u636e\u5e93\u8fde\u63a5\u72b6\u6001&#xff1b;<\/li>\n<li>\u8fd0\u884c\u6307\u6807&#xff1b;<\/li>\n<li>\u590d\u5236\u72b6\u6001&#xff1b;<\/li>\n<li>\u6027\u80fd\u4fe1\u606f&#xff1b;<\/li>\n<li>\u5b9e\u4f8b\u6807\u7b7e\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u4fe1\u606f\u672c\u8eab\u5c31\u5c5e\u4e8e\u8fd0\u7ef4\u6570\u636e\u3002<\/p>\n<p>\u6240\u4ee5\u771f\u6b63\u957f\u671f\u8fdc\u7a0b\u6293\u53d6\u65f6&#xff0c;\u4e0d\u5e94\u8be5\u53ea\u8003\u8651\u201cPrometheus\u80fd\u4e0d\u80fd\u8bbf\u95ee\u201d&#xff0c;\u8fd8\u8981\u8003\u8651&#xff1a;<\/p>\n<ul>\n<li>\u5730\u5740\u662f\u5426\u9700\u8981\u5c0f\u8303\u56f4\u53ef\u89c1&#xff1b;<\/li>\n<li>\u662f\u5426\u589e\u52a0\u989d\u5916\u8ba4\u8bc1&#xff1b;<\/li>\n<li>\u662f\u5426\u9650\u5236\u6765\u6e90&#xff1b;<\/li>\n<li>\u662f\u5426\u771f\u7684\u9700\u8981\u628a\u6307\u6807\u7aef\u70b9\u516c\u5f00\u5230\u4e92\u8054\u7f51\u3002<\/li>\n<\/ul>\n<p>cpolar \u53ea\u8d1f\u8d23\u7f51\u7edc\u5165\u53e3\u3002<\/p>\n<p>\u8bbf\u95ee\u63a7\u5236\u4ecd\u7136\u9700\u8981\u7ed3\u5408\u5b9e\u9645\u73af\u5883\u8bbe\u8ba1\u3002<\/p>\n<h3>21 \u968f\u673a\u5730\u5740\u9002\u5408\u5148\u9a8c\u8bc1<\/h3>\n<p>\u5982\u679c\u53ea\u662f\u4e34\u65f6\u6d4b\u8bd5\u8fdc\u7a0b\u6293\u53d6&#xff0c;\u968f\u673a\u5730\u5740\u5df2\u7ecf\u8db3\u591f\u3002<\/p>\n<p>\u5148\u786e\u8ba4&#xff1a;<\/p>\n<ul>\n<li>9105\u7aef\u70b9\u80fd\u6253\u5f00&#xff1b;<\/li>\n<li>Prometheus\u80fd\u6293&#xff1b;<\/li>\n<li>Target\u72b6\u6001\u6b63\u5e38&#xff1b;<\/li>\n<li>\u6307\u6807\u80fd\u67e5\u8be2\u3002<\/li>\n<\/ul>\n<p>\u9a8c\u8bc1\u5b8c\u6210\u4ee5\u540e&#xff0c;\u518d\u8003\u8651\u957f\u671f\u56fa\u5b9a\u5730\u5740\u3002<\/p>\n<h3>22 \u914d\u7f6e\u56fa\u5b9a\u4e8c\u7ea7\u5b50\u57df\u540d<\/h3>\n<p>\u8fdb\u5165\u9884\u7559\u9875\u9762&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20t3mslyq250p.png\" alt=\"image-20251125141035399\" \/><\/p>\n<p>\u793a\u4f8b\u540d\u79f0\u4f7f\u7528&#xff1a;<\/p>\n<p>mysqll<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20ma5cvric2xn.png\" alt=\"image-20251125141009206\" \/><\/p>\n<p>\u8fd9\u91cc\u6bd4 mysql \u591a\u4e86\u4e00\u4e2a l\u3002<\/p>\n<p>\u4e8c\u7ea7\u5b50\u57df\u540d\u672c\u8eab\u53ef\u4ee5\u81ea\u5b9a\u4e49&#xff0c;\u6240\u4ee5\u6280\u672f\u4e0a\u4e0d\u4e00\u5b9a\u6709\u95ee\u9898\u3002<\/p>\n<p>\u4f46\u5982\u679c\u5e0c\u671b\u540d\u79f0\u548c\u670d\u52a1\u4fdd\u6301\u4e00\u81f4&#xff0c;\u81ea\u5df1\u914d\u7f6e\u65f6\u6700\u597d\u7edf\u4e00\u547d\u540d\u3002<\/p>\n<h3>23 \u628a\u96a7\u9053\u5207\u6362\u4e3a\u56fa\u5b9a\u5730\u5740<\/h3>\n<p>\u8fdb\u5165\u96a7\u9053\u5217\u8868&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-204syunx12jkq.png\" alt=\"image-20251125141100804\" \/><\/p>\n<p>\u4fee\u6539&#xff1a;<\/p>\n<ul>\n<li>\u57df\u540d\u7c7b\u578b&#xff1a;\u4e8c\u7ea7\u5b50\u57df\u540d&#xff1b;<\/li>\n<li>Sub Domain&#xff1a;\u586b\u5199\u9884\u7559\u540d\u79f0&#xff1b;<\/li>\n<li>\u5730\u533a&#xff1a;China Top\u3002<\/li>\n<\/ul>\n<p>\u66f4\u65b0&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-2053dhhrroapo.png\" alt=\"image-20251125141128044\" \/><\/p>\n<p>\u67e5\u770b\u5728\u7ebf\u96a7\u9053&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-20ekmfcx20k12.png\" alt=\"image-20251125141147962\" \/><\/p>\n<p>\u6700\u540e\u4f7f\u7528\u56fa\u5b9a\u5730\u5740\u8bbf\u95ee&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"2026-10-205bwop40frd1.png\" alt=\"image-20251125141202184\" \/><\/p>\n<p>\u9875\u9762\u6b63\u5e38\u6253\u5f00\u4ee5\u540e&#xff0c;\u56fa\u5b9a\u5165\u53e3\u5c31\u914d\u7f6e\u5b8c\u6210\u3002<\/p>\n<p>\u5177\u4f53\u56fa\u5b9a\u57df\u540d\u3001\u5957\u9910\u548c\u4f7f\u7528\u89c4\u5219\u53ef\u80fd\u53d8\u5316&#xff0c;\u5e94\u4ee5\u5b9e\u9645\u8d26\u53f7\u9875\u9762\u4e3a\u51c6\u3002<\/p>\n<h3>24 \u8fd9\u7bc7\u771f\u6b63\u8dd1\u901a\u4e86\u54ea\u4e9b\u73af\u8282<\/h3>\n<p>\u5b9e\u9645\u5b8c\u6210&#xff1a;<\/p>\n<ul>\n<li>mysqld_exporter 0.18.0 \u4e0b\u8f7d&#xff1b;<\/li>\n<li>MySQL\u76d1\u63a7\u7528\u6237\u4e0e\u6743\u9650&#xff1b;<\/li>\n<li>9105\u6307\u6807\u7aef\u70b9&#xff1b;<\/li>\n<li>Prometheus\u672c\u5730\u6293\u53d6&#xff1b;<\/li>\n<li>Target\u9a8c\u8bc1&#xff1b;<\/li>\n<li>MySQL\u544a\u8b66\u89c4\u5219&#xff1b;<\/li>\n<li>MySQL\u505c\u6b62\u540e\u544a\u8b66\u51fa\u73b0&#xff1b;<\/li>\n<li>MySQL\u6062\u590d\u540e\u72b6\u6001\u6062\u590d&#xff1b;<\/li>\n<li>9105\u516c\u7f51\u8bbf\u95ee&#xff1b;<\/li>\n<li>\u5f02\u5730Prometheus\u6293\u53d6&#xff1b;<\/li>\n<li>\u56fa\u5b9a\u4e8c\u7ea7\u5b50\u57df\u540d\u3002<\/li>\n<\/ul>\n<p>\u6ca1\u6709\u5b8c\u6574\u5c55\u793a&#xff1a;<\/p>\n<ul>\n<li>Grafana\u4eea\u8868\u76d8&#xff1b;<\/li>\n<li>Alertmanager receiver&#xff1b;<\/li>\n<li>\u90ae\u4ef6 \/ Webhook \/ IM\u901a\u77e5&#xff1b;<\/li>\n<li>exporter\u7aef\u70b9\u8ba4\u8bc1&#xff1b;<\/li>\n<li>\u591a\u5b9e\u4f8b\u96c6\u4e2d\u76d1\u63a7&#xff1b;<\/li>\n<li>\u957f\u671f\u5b89\u5168\u8bbf\u95ee\u7b56\u7565\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5\u6587\u7ae0\u6700\u51c6\u786e\u7684\u5b9a\u4f4d\u662f&#xff1a;<\/p>\n<p>\u628aMySQL\u6307\u6807\u4ece\u6570\u636e\u5e93\u5185\u90e8\u5e26\u5230Prometheus&#xff0c;\u5e76\u7ee7\u7eed\u9a8c\u8bc1\u544a\u8b66\u89c4\u5219\u548c\u5f02\u5730\u6293\u53d6\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u8fd9\u6b21\u771f\u6b63\u8dd1\u901a\u7684\u662f\u4e00\u6761\u5b8c\u6574\u7684MySQL\u6307\u6807\u94fe&#xff1a;MySQL\u8d1f\u8d23\u63d0\u4f9b\u8fd0\u884c\u72b6\u6001&#xff0c;mysqld_exporter\u628a\u8fd9\u4e9b\u72b6\u6001\u66b4\u9732\u52309105&#xff0c;Prometheus\u518d\u8d1f\u8d23\u6293\u53d6\u3001\u67e5\u8be2\u548c\u8bc4\u4f30\u544a\u8b66\u89c4\u5219\u3002<\/p>\n<p>\u6700\u6709\u4ef7\u503c\u7684\u9a8c\u8bc1\u4e0d\u662f\u201c\u9875\u9762\u80fd\u6253\u5f00\u201d&#xff0c;\u800c\u662fMySQL\u505c\u6b62\u4ee5\u540ePrometheus\u544a\u8b66\u771f\u7684\u51fa\u73b0&#xff0c;\u91cd\u65b0\u542f\u52a8\u540e\u72b6\u6001\u53c8\u6062\u590d\u3002\u8fd9\u8bf4\u660e\u4ece\u6570\u636e\u5e93\u72b6\u6001\u53d8\u5316\u5230\u544a\u8b66\u89c4\u5219\u5224\u65ad\u7684\u94fe\u8def\u786e\u5b9e\u5728\u5de5\u4f5c\u3002<\/p>\n<p>\u8fdc\u7a0b\u90e8\u5206\u5219\u628a9105\u63d0\u4f9b\u7ed9\u5f02\u5730Prometheus\u6293\u53d6&#xff0c;\u4f46\u6307\u6807\u7aef\u70b9\u672c\u8eab\u5c5e\u4e8e\u8fd0\u7ef4\u4fe1\u606f&#xff0c;\u4e0d\u5e94\u8be5\u56e0\u4e3a\u80fd\u901a\u8fc7\u516c\u7f51\u8bbf\u95ee\u5c31\u5ffd\u7565\u8ba4\u8bc1\u548c\u66b4\u9732\u8303\u56f4\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;\u90e8\u7f72\u91cc\u51e0\u4e2a\u7528\u6237\u540d\u548c\u76ee\u5f55\u540d\u4e0d\u4e00\u81f4\u7684\u95ee\u9898\u4e00\u5b9a\u8981\u5148\u6838\u5bf9\u6e05\u695a\u3002\u628a\u8fd9\u4e9b\u7ec6\u8282\u5904\u7406\u597d\u4ee5\u540e&#xff0c;\u8fd9\u5957\u65b9\u6848\u624d\u66f4\u9002\u5408\u4f5c\u4e3aMySQL\u76d1\u63a7\u94fe\u7684\u57fa\u7840\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/p>\n","protected":false},"author":2,"featured_media":115929,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11820,114,678,43],"topic":[],"class_list":["post-115949","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-atomgit","tag-mysql","tag-prometheus","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86 - \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\/115949.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/115949.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-20T07:17:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad715722041a.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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115949.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/115949.html\",\"name\":\"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-20T07:17:12+00:00\",\"dateModified\":\"2026-10-20T07:17:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/115949.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/115949.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115949.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86\"}]},{\"@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":"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86 - \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\/115949.html","og_locale":"zh_CN","og_type":"article","og_title":"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/115949.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-20T07:17:12+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020071706-6ad715722041a.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/115949.html","url":"https:\/\/www.wsisp.com\/helps\/115949.html","name":"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-20T07:17:12+00:00","dateModified":"2026-10-20T07:17:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/115949.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/115949.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/115949.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Prometheus\u5df2\u7ecf\u80fd\u76d1\u63a7\u670d\u52a1\u5668\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u662f\u770b\u4e0d\u5230MySQL\u72b6\u6001\uff1f\u6211\u7528mysqld_exporter\u628a9105\u6307\u6807\u548c\u544a\u8b66\u94fe\u8def\u63a5\u8d77\u6765\u4e86"}]},{"@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\/115949","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=115949"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115949\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/115929"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=115949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=115949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=115949"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=115949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}