{"id":458,"date":"2020-05-08T18:25:27","date_gmt":"2020-05-08T10:25:27","guid":{"rendered":"http:\/\/opensource.dwins.com\/?p=458"},"modified":"2020-05-08T18:25:29","modified_gmt":"2020-05-08T10:25:29","slug":"%e5%9c%a8windows-%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%9d-mysql_exporter","status":"publish","type":"post","link":"https:\/\/opensource.dwins.com\/?p=458","title":{"rendered":"\u5728Windows \u5982\u4f55\u5b89\u88dd mysql_exporter"},"content":{"rendered":"\n<ol><li> \u6e96\u5099 Mysql \u8cc7\u6599\u5eab\u53ca\u9023\u7dda\u5e33\u6236<\/li><li>\u4e0b\u8f09exporter <\/li><li> \u914d\u7f6eexporter <\/li><li> \u914d\u7f6ePrometheus <\/li><li> Grafana dashboard <\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"> \u6e96\u5099 Mysql \u8cc7\u6599\u5eab\u53ca\u9023\u7dda\u5e33\u6236<\/h2>\n\n\n\n<p>\u5efa\u7acb\u4e00\u500b\u8cc7\u6599\u5eab\u7528\u6236\u548c\u6b0a\u9650: myuser \/ mypass<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"> \u4e0b\u8f09exporter <\/h2>\n\n\n\n<ul><li>\u4e0b\u8f09\u9ede :  <a href=\"https:\/\/prometheus.io\/download\/\">https:\/\/prometheus.io\/download\/#mysqld_exporter<\/a><\/li><li>\u4e0b\u8f09\u6a94\u6848: <ul><li> Windows : <a href=\"https:\/\/github.com\/prometheus\/mysqld_exporter\/releases\/download\/v0.12.1\/mysqld_exporter-0.12.1.windows-amd64.tar.gz\">mysqld_exporter-0.12.1.windows-amd64.tar.gz<\/a><\/li><li> Linux : <a href=\"https:\/\/github.com\/prometheus\/mysqld_exporter\/releases\/download\/v0.12.1\/mysqld_exporter-0.12.1.linux-amd64.tar.gz\">mysqld_exporter-0.12.1.linux-amd64.tar.gz<\/a><\/li><\/ul><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u914d\u7f6eexporter <\/h2>\n\n\n<p>\u7de8\u8f2f\u4e00\u500b\u6a94\u6848mysql.cnf.txt, \u5167\u5bb9\u70ba<\/p>\n<p>[<span style=\"color: #0000ff;\">client]<\/span><\/p>\n<p><span style=\"color: #0000ff;\">user=myuser<\/span><\/p>\n<p><span style=\"color: #0000ff;\">password=mypass<\/span><\/p>\n<p>\u4ee5\u547d\u4ee4\u555f\u52d5&gt; mysqld_exporter \u2013config.my-cnf=mysql.cnf.txt \u6216\u662f\u6539\u4ee5nssm \u8f49\u70ba\u670d\u52d9.<\/p>\n<p>\u6e2c\u8a66\u00a0 <a href=\"http:\/\/localhost:9104\/metrics\">http:\/\/localhost:9104\/metrics<\/a>, \u662f\u5426\u6709\u56de\u50b3, \u4e26\u6aa2\u67e5\u5167\u5bb9\u662f\u5426 mysql_up \u70ba1, \u82e5\u4e0d\u662f\u6aa2\u67e5\u5e33\u6236\u662f\u5426\u6b63\u78ba<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u914d\u7f6ePrometheus <\/h2>\n\n\n<p>\u4fee\u6539 Prometheus.yml\u6a94\u6848, \u4e26\u65b0\u589e\u4ee5\u4e0b\u7247\u65b7<\/p>\n<p><span style=\"color: #0000ff;\">\u00a0&#8211; job_name: &#8216;mysql&#8217;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 static_configs:<\/span><\/p>\n<p><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &#8211; targets: [&#8216;10.1.4.225:9104&#8217;]<\/span><\/p>\n<p>\u91cd\u65b0\u8f09\u5165\u53c3\u6578\u6a94\u6216\u662f\u91cd\u65b0\u555f\u52d5\u5f8c, \u767b\u5165 Prometheus \u7ba1\u7406\u4ecb\u9762\u4e26\u6aa2\u67e5\u662f\u5426\u5b58\u5728mysql \u7684 metrics<\/p>\n\n\n<h2 class=\"wp-block-heading\"> Grafana dashboard <\/h2>\n\n\n\n<p> Grafana dashboard ID 7362  , \u6ed9\u5165\u6a23\u672c\u5100\u8868\u677f(\u6ce8\u610f: \u8cc7\u6599\u5eab\u9078\u64c7)\u5373\u53ef\u770b\u5230\u5100\u8868\u677f.<\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide\" style=\"grid-template-columns:61% auto\"><figure class=\"wp-block-media-text__media\"><img decoding=\"async\" loading=\"lazy\" width=\"566\" height=\"403\" src=\"https:\/\/opensource.dwins.com\/wp-content\/uploads\/2020\/05\/image.png\" alt=\"\" class=\"wp-image-459\" srcset=\"https:\/\/opensource.dwins.com\/wp-content\/uploads\/2020\/05\/image.png 566w, https:\/\/opensource.dwins.com\/wp-content\/uploads\/2020\/05\/image-300x214.png 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">MySQL <\/p>\n\n\n\n<p class=\"has-large-font-size\">> mysql_exporter > prometheus > Grafana, dashboard<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6e96\u5099 Mysql \u8cc7\u6599\u5eab\u53ca\u9023\u7dda\u5e33\u6236 \u4e0b\u8f09exporter \u914d\u7f6eexporter \u914d\u7f6ePrometheus Gr &#8230; <a title=\"\u5728Windows \u5982\u4f55\u5b89\u88dd mysql_exporter\" class=\"read-more\" href=\"https:\/\/opensource.dwins.com\/?p=458\">\u95b1\u8b80\u66f4\u591a <span class=\"screen-reader-text\">\u5728Windows \u5982\u4f55\u5b89\u88dd mysql_exporter<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[25,24],"_links":{"self":[{"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=\/wp\/v2\/posts\/458"}],"collection":[{"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=458"}],"version-history":[{"count":1,"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=\/wp\/v2\/posts\/458\/revisions"}],"predecessor-version":[{"id":460,"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=\/wp\/v2\/posts\/458\/revisions\/460"}],"wp:attachment":[{"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opensource.dwins.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}