{"id":2911,"date":"2021-01-12T10:54:35","date_gmt":"2021-01-12T02:54:35","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=2911"},"modified":"2021-02-23T22:59:28","modified_gmt":"2021-02-23T14:59:28","slug":"prometheus","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2021\/01\/12\/prometheus\/","title":{"rendered":"Docker\u642d\u5efaprometheus\u76d1\u63a7"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong> \u4ec0\u4e48\u662f Prometheus\uff1f <\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/prometheus\" target=\"_blank\">Prometheus<\/a> \u662f\u7531\u524d Google \u5de5\u7a0b\u5e08\u4ece 2012 \u5e74\u5f00\u59cb\u5728 <a rel=\"noreferrer noopener\" href=\"http:\/\/soundcloud.com\/\" target=\"_blank\">Soundcloud<\/a> \u4ee5\u5f00\u6e90\u8f6f\u4ef6\u7684\u5f62\u5f0f\u8fdb\u884c\u7814\u53d1\u7684\u7cfb\u7edf\u76d1\u63a7\u548c\u544a\u8b66\u5de5\u5177\u5305\uff0c\u81ea\u6b64\u4ee5\u540e\uff0c\u8bb8\u591a\u516c\u53f8\u548c\u7ec4\u7ec7\u90fd\u91c7\u7528\u4e86 Prometheus \u4f5c\u4e3a\u76d1\u63a7\u544a\u8b66\u5de5\u5177\u3002Prometheus \u7684\u5f00\u53d1\u8005\u548c\u7528\u6237\u793e\u533a\u975e\u5e38\u6d3b\u8dc3\uff0c\u5b83\u73b0\u5728\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u53ef\u4ee5\u72ec\u7acb\u4e8e\u4efb\u4f55\u516c\u53f8\u8fdb\u884c\u7ef4\u62a4\u3002\u4e3a\u4e86\u8bc1\u660e\u8fd9\u4e00\u70b9\uff0cPrometheus \u4e8e 2016 \u5e74 5 \u6708\u52a0\u5165 <a rel=\"noreferrer noopener\" href=\"https:\/\/cncf.io\/\" target=\"_blank\">CNCF<\/a> \u57fa\u91d1\u4f1a\uff0c\u6210\u4e3a\u7ee7 <a rel=\"noreferrer noopener\" href=\"http:\/\/kubernetes.io\/\" target=\"_blank\">Kubernetes<\/a> \u4e4b\u540e\u7684\u7b2c\u4e8c\u4e2a CNCF \u6258\u7ba1\u9879\u76ee\u3002 <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u90e8\u7f72\u65b9\u6cd5\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u901a\u8fc7\u547d\u4ee4\u62c9\u53d6prometheus\u955c\u50cf\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker pull   prometheus<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u901a\u8fc7\u547d\u4ee4\u542f\u52a8prometheus\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker run -itd  &#8211;name prometheus -v \/etc\/prometheus:\/etc\/prometheus  -p 9000:9090  prometheus <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u542f\u52a8\u540e\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"280\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/24.png\" alt=\"\" class=\"wp-image-2912\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/24.png 560w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/24-300x150.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/figure>\n\n\n\n<p class=\"has-background has-luminous-vivid-amber-background-color wp-block-paragraph\">\u4ece\u4e0a\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u5c06\u5bb9\u5668\u5185\u90e8\u7684\/etc\/prometheus\u76ee\u5f55\u6302\u8f7d\u51fa\u6765\uff0c\u65b9\u4fbf\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6,\u5e76\u5c06\u5bb9\u5668\u5185\u90e8\u76849090\u7aef\u53e3\u6620\u5c04\u4e3a\u5916\u90e8\u76849000\u7aef\u53e3<\/p>\n\n\n\n<p class=\"has-text-align-center has-medium-font-size wp-block-paragraph\"><strong>\u76d1\u63a7\u4e3b\u673a\u7cfb\u7edf<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> node_exporter \u672c\u8d28\u5c31\u662f\u76d1\u63a7\u4e3b\u673a\u7cfb\u7edf,\u6240\u4ee5\u4e0d\u5efa\u8bae\u5c06\u5176\u90e8\u7f72\u4e3a docker \u5bb9\u5668<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u5c06node_exporter-0.18.1.linux-amd64.tar.gz\u89e3\u538b\u540e\uff0c\u79fb\u52a8\u5230\/usr\/local\/\u76ee\u5f55\u4e0b\uff0c\u8fdb\u5165\u76ee\u5f55\u4e2d\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"591\" height=\"192\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/1-4.png\" alt=\"\" class=\"wp-image-2914\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/1-4.png 591w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/1-4-300x97.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u7f16\u8f91\u670d\u52a1\u6587\u4ef6node_exporter.service\uff0c\u4fee\u6539\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"339\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/2-2.png\" alt=\"\" class=\"wp-image-2915\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/2-2.png 549w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/2-2-300x185.png 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u6267\u884c\u547d\u4ee4systemctl enable  node_exporter\uff0csystemctl start node_exporter\u542f\u52a8node_exporter\uff0c\u53ef\u4ee5\u770b\u5230\u8fdb\u7a0b\u5728\u8fd0\u884c\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"259\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/3-3.png\" alt=\"\" class=\"wp-image-2916\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/3-3.png 665w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/3-3-300x117.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/3-3-600x234.png 600w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u7f16\u8f91prometheus\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"186\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/4-1.png\" alt=\"\" class=\"wp-image-2918\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/4-1.png 549w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/4-1-300x102.png 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u91cd\u542fprometheus\u540e\uff0c\u53ef\u4ee5\u770b\u5230\u76d1\u63a7\u72b6\u6001\u5df2\u7ecf\u53d8\u6210up\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"552\" height=\"267\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/5-1.png\" alt=\"\" class=\"wp-image-2920\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/5-1.png 552w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/01\/5-1-300x145.png 300w\" sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f Prometheus\uff1f Prometheus \u662f\u7531\u524d Google \u5de5\u7a0b\u5e08\u4ece 2012 \u5e74\u5f00\u59cb\u5728 So [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":2921,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112,23],"tags":[115],"class_list":["post-2911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-prometheus","category-rong","tag-prometheus"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2911"}],"version-history":[{"count":3,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2911\/revisions"}],"predecessor-version":[{"id":2922,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2911\/revisions\/2922"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/2921"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}