{"id":6933,"date":"2022-12-18T13:38:44","date_gmt":"2022-12-18T04:38:44","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=6933"},"modified":"2022-12-23T07:20:13","modified_gmt":"2022-12-22T22:20:13","slug":"prometheus%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88rocky-linux-9%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/6933","title":{"rendered":"Prometheus\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08Rocky Linux 9\uff09"},"content":{"rendered":"<p>Prometheus\u3092Rocky Linux 9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h2>Prometheus\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\uff01<\/h2>\n<p>Prometheus\u306fPrometheus\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002GitHub\u304b\u3089\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u306e\u3067\u3001GitHub\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u3059\u308b\u5834\u5408\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u3001GitHub\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/prometheus.io\/download\/\" target=\"_blank\" rel=\"noopener\">Prometheus - Download<\/a><\/li>\n<\/ul>\n<p>Prometheus\u3092\u914d\u7f6e\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ mkdir -p prometheus\/prometheus\r\n$ cd prometheus\/prometheus\r\n<\/pre>\n<p>\u4f5c\u6210\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3001Prometheus\u306eLinux\u7248\u3092GitHub\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ wget https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.41.0\/prometheus-2.41.0.linux-amd64.tar.gz\r\n$ ls -l\r\ntotal 88216\r\n-rw-r--r-- 1 usradmin usradmin 90331753 Dec 20 20:15 prometheus-2.41.0.linux-amd64.tar.gz\r\n<\/pre>\n<h2>Prometheus\u3092\u5c55\u958b\u3059\u308b\uff01<\/h2>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fPrometheus\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5c55\u958b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ tar -zxvf prometheus-2.41.0.linux-amd64.tar.gz\r\npprometheus-2.41.0.linux-amd64\/\r\nprometheus-2.41.0.linux-amd64\/consoles\/\r\nprometheus-2.41.0.linux-amd64\/consoles\/node-disk.html\r\nprometheus-2.41.0.linux-amd64\/consoles\/node-cpu.html\r\nprometheus-2.41.0.linux-amd64\/consoles\/index.html.example\r\nprometheus-2.41.0.linux-amd64\/consoles\/node-overview.html\r\nprometheus-2.41.0.linux-amd64\/consoles\/node.html\r\nprometheus-2.41.0.linux-amd64\/consoles\/prometheus.html\r\nprometheus-2.41.0.linux-amd64\/consoles\/prometheus-overview.html\r\nprometheus-2.41.0.linux-amd64\/console_libraries\/\r\nprometheus-2.41.0.linux-amd64\/console_libraries\/prom.lib\r\nprometheus-2.41.0.linux-amd64\/console_libraries\/menu.lib\r\nprometheus-2.41.0.linux-amd64\/NOTICE\r\nprometheus-2.41.0.linux-amd64\/prometheus\r\nprometheus-2.41.0.linux-amd64\/LICENSE\r\nprometheus-2.41.0.linux-amd64\/prometheus.yml\r\nprometheus-2.41.0.linux-amd64\/promtool\r\n<\/pre>\n<h2>Prometheus\u3092\u8d77\u52d5\u3059\u308b\uff01<\/h2>\n<p>Prometheus\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cd prometheus-2.41.0.linux-amd64\/\r\n$ .\/prometheus\r\n...\r\nts=2022-12-20T23:22:14.397Z caller=main.go:1197 level=info msg=&quot;Loading configuration file&quot; filename=prometheus.yml\r\nts=2022-12-20T23:22:14.398Z caller=main.go:1234 level=info msg=&quot;Completed loading of configuration file&quot; filename=prometheus.yml totalDuration=630.684\u00b5s db_storage=689ns remote_storage=930ns web_handler=365ns query_engine=538ns scrape=291.424\u00b5s scrape_sd=14.252\u00b5s notify=19.615\u00b5s notify_sd=6.81\u00b5s rules=802ns tracing=3.865\u00b5s\r\nts=2022-12-20T23:22:14.398Z caller=main.go:978 level=info msg=&quot;Server is ready to receive web requests.&quot;\r\nts=2022-12-20T23:22:14.398Z caller=manager.go:953 level=info component=&quot;rule manager&quot; msg=&quot;Starting rule manager...&quot;\r\n<\/pre>\n<p>Prometheus\u306e\u505c\u6b62\u306f\u3001\u300cCtrl-c\u300d\u3067\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>Prometheus\u306eWeb\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\uff01<\/h2>\n<p>\u30ed\u30fc\u30ab\u30eb\u306e\u30de\u30b7\u30f3\u304b\u3089\u306f\u30019090\u30dd\u30fc\u30c8\u3067Web\u4eca\u30c9\u30fc\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5834\u5408\u306f\u3001Firewalld\u3067\u901a\u4fe1\u306e\u8a31\u53ef\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhttp:\/\/localhost:9090\r\n<\/pre>\n<h2>Prometheus\u3092Systemd\u3067\u81ea\u52d5\u8d77\u52d5\u3059\u308b\uff01<\/h2>\n<p>systemd\u306eUnit\u306e\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cat prometheus.service\r\n&#x5B;Unit]\r\nDescription=Prometheus\r\nDocumentation=https:\/\/github.com\/prometheus\/prometheus\r\n\r\n&#x5B;Service]\r\nType=simple\r\nWorkingDirectory=\/home\/usradmin\/prometheus\/prometheus\/prometheus-2.41.0.linux-amd64\/\r\nExecStart=\/home\/usradmin\/prometheus\/prometheus\/prometheus-2.41.0.linux-amd64\/prometheus --config.file=\/home\/usradmin\/prometheus\/prometheus\/prometheus-2.41.0.linux-amd64\/prometheus.yml\r\nExecStop=\/bin\/kill -TERM ${MAINPID}\r\nExecReload=\/bin\/kill -HUP ${MAINPID}\r\nRestart=always\r\nUser=usradmin\r\n\r\n&#x5B;Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>Unit\u3092\u767b\u9332\u3057\u3001\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl daemon-reload \r\n$ sudo systemctl enable prometheus.service\r\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/prometheus.service \u2192 \/etc\/systemd\/system\/prometheus.service.\r\n$ sudo systemctl start prometheus.service\r\n$ sudo systemctl status prometheus.service\r\n\u25cf prometheus.service - Prometheus\r\n     Loaded: loaded (\/etc\/systemd\/system\/prometheus.service; enabled; vendor preset: disabled)\r\n     Active: active (running) since Fri 2022-12-23 07:19:03 JST; 4s ago\r\n...\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Prometheus\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3068\u3066\u3082\u5bb9\u6613\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u5c55\u958b\u3059\u308b\u3060\u3051\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/prometheus.io\/docs\/introduction\/overview\/\" target=\"_blank\" rel=\"noopener\">Prometheus - Overview<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/6930\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Prometheus\u3067\u904b\u7528\u76e3\u8996\u3092\u884c\u3046\u3002\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/12\/eycatch_prometheus_02-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Prometheus\u3067\u904b\u7528\u76e3\u8996\u3092\u884c\u3046\u3002<\/div><div class=\"substr\">Prometheus\u3067\u904b\u7528\u76e3\u8996\u3092\u884c\u3046\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n<h2>Prometheus\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<p><iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=infotecr-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=4910313001&linkId=9dc0000731d00570df8bebb953fc3998\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prometheus\u3092Rocky Linux 9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 Prometheus\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\uff01 Prometheus\u306fPrometheus\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002GitHub\u304b\u3089\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u306e\u3067\u3001G\u2026<\/p>\n","protected":false},"author":1,"featured_media":7003,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[179],"tags":[],"class_list":["post-6933","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-prometheus"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/6933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=6933"}],"version-history":[{"count":0,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/6933\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/7003"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=6933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=6933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=6933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}