{"id":3182,"date":"2021-08-28T14:28:34","date_gmt":"2021-08-28T05:28:34","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=3182"},"modified":"2021-09-22T21:08:48","modified_gmt":"2021-09-22T12:08:48","slug":"nomad-%eb%a1%9c%ea%b7%b8-%ed%99%95%ec%9d%b8%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=3182","title":{"rendered":"nomad \ub85c\uadf8 \ud655\uc778\ud558\uae30"},"content":{"rendered":"<h1>nomad \ub85c\uadf8 \ud655\uc778\ud558\uae30<\/h1>\n<p>\ub178\ub9c8\ub4dc \ub85c\uadf8\ub294 \uc624\ub958\uac00 \ubc1c\uc0dd\ud55c \uc704\uce58\uc5d0 \ub530\ub77c,<br \/>\nApplication Level \uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\ub3c4,<br \/>\n\ub610\ub294 nomad \uc790\uccb4\uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud574\uc57c \ud558\ub294 \uacbd\uc6b0,<br \/>\n\uadf8\ub9ac\uace0 Docker \ub97c \uc774\uc6a9\ud588\ub2e4\uba74 Docker \uc5d0\uc11c \ub85c\uadf8\ub97c \ud655\uc778\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \ubc1c\uc0dd\ud569\ub2c8\ub2e4.<\/p>\n<h2>Application Log \ud655\uc778\ud558\uae30<\/h2>\n<pre><code class=\"language-bash\">nomad status<\/code><\/pre>\n<pre><code class=\"language-bash\">ID          Type     Priority  Status   Submit Date\nautoscaler  service  50        running  2021-08-28T12:17:52+09:00\ngrafana     service  50        running  2021-08-28T12:08:54+09:00\nhaproxy     service  50        running  2021-08-28T12:50:07+09:00\nhello       service  50        running  2021-08-28T14:17:52+09:00\nprometheus  service  50        running  2021-08-28T12:54:02+09:00<\/code><\/pre>\n<pre><code class=\"language-bash\">nomad status hello<\/code><\/pre>\n<pre><code class=\"language-bash\">ID            = hello\nName          = hello\nSubmit Date   = 2021-08-28T14:17:52+09:00\nType          = service\nPriority      = 50\nDatacenters   = dc1\nNamespace     = default\nStatus        = running\nPeriodic      = false\nParameterized = false\n\nSummary\nTask Group  Queued  Starting  Running  Failed  Complete  Lost\nhelloGroup  0       0         1        2       4         0\n\nLatest Deployment\nID          = cd9dbe0a\nStatus      = successful\nDescription = Deployment completed successfully\n\nDeployed\nTask Group  Desired  Placed  Healthy  Unhealthy  Progress Deadline\nhelloGroup  1        1       1        0          2021-08-28T14:28:19+09:00\n\nAllocations\nID        Node ID   Task Group  Version  Desired  Status    Created     Modified\nd43bab59  a5c3b874  helloGroup  7        run      running   3m18s ago   2m51s ago\n5d5a2124  a5c3b874  helloGroup  6        stop     complete  20m17s ago  3m17s ago\n00a33b57  a5c3b874  helloGroup  5        stop     complete  30m44s ago  5m6s ago\n8195402d  a5c3b874  helloGroup  3        stop     complete  39m54s ago  5m6s ago\nf667514c  a5c3b874  helloGroup  3        stop     failed    1h3s ago    5m6s ago\ncf08455b  a5c3b874  helloGroup  3        stop     failed    1h48m ago   5m6s ago\nba0fae1f  a5c3b874  helloGroup  1        stop     complete  1h59m ago   5m6s ago<\/code><\/pre>\n<p>Allocations ID \ub97c \uc774\uc6a9\ud574 \uc571\uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">nomad alloc logs d43bab59<\/code><\/pre>\n<pre><code class=\"language-bash\">  .   ____          _            __ _ _\n \/\\\\ \/ ___&#039;_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\n( ( )\\___ | &#039;_ | &#039;_| | &#039;_ \\\/ _` | \\ \\ \\ \\\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\n  &#039;  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\n =========|_|==============|___\/=\/_\/_\/_\/\n :: Spring Boot ::                (v2.5.3)\n\n2021-08-28 14:18:07.569  INFO 1 --- [           main] c.e.testpublic.TestPublicApplication     : Starting TestPublicApplication using Java 11.0.11 on notebook with PID 1 (\/local\/TestPublic-0.0.2-SNAPSHOT.jar started by nobody in \/)\n2021-08-28 14:18:07.571  INFO 1 --- [           main] c.e.testpublic.TestPublicApplication     : No active profile set, falling back to default profiles: default\n2021-08-28 14:18:08.351  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 20256 (http)\n2021-08-28 14:18:08.362  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]\n2021-08-28 14:18:08.362  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat\/9.0.50]\n2021-08-28 14:18:08.412  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[\/]       : Initializing Spring embedded WebApplicationContext\n2021-08-28 14:18:08.412  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 801 ms\n2021-08-28 14:18:08.700  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 20256 (http) with context path &#039;&#039;\n2021-08-28 14:18:08.708  INFO 1 --- [           main] c.e.testpublic.TestPublicApplication     : Started TestPublicApplication in 1.526 seconds (JVM running for 1.895)\n2021-08-28 14:18:09.254  INFO 1 --- [io-20256-exec-1] o.a.c.c.C.[Tomcat].[localhost].[\/]       : Initializing Spring DispatcherServlet &#039;dispatcherServlet&#039;\n2021-08-28 14:18:09.254  INFO 1 --- [io-20256-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet &#039;dispatcherServlet&#039;\n2021-08-28 14:18:09.255  INFO 1 --- [io-20256-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms\n<\/code><\/pre>\n<h2>nomad \ub85c\uadf8 \ud655\uc778\ud558\uae30<\/h2>\n<p>\uac00\ub054 \uc571\uc774 \uc2e4\ud589\uc870\ucc28 \ubabb\ud558\uace0 \uc885\ub8cc\ud558\ub294 \uacbd\uc6b0\uac00 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\ub7f0 \uacbd\uc6b0 \ub178\ub9c8\ub4dc \uc790\uccb4\uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud574 \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">sudo mkdir -p \/var\/log\/nomad<\/code><\/pre>\n<p>\ub85c\uadf8 \ud3f4\ub354\ub97c \ub9cc\ub4e4\uc5b4\uc90d\ub2c8\ub2e4.<br \/>\n(\ub178\ub9c8\ub4dc\uac00 \uc790\ub3d9\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \uc8fc\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.)<\/p>\n<pre><code class=\"language-bash\">sudo vi \/etc\/nomad.d\/nomad.hcl<\/code><\/pre>\n<pre><code class=\"language-bash\">server {\n  enabled          = true\n  bootstrap_expect = 1\n}\n\nlog_file = &quot;\/var\/log\/nomad\/&quot;\nlog_level = &quot;DEBUG&quot;<\/code><\/pre>\n<pre><code class=\"language-bash\">sudo systemctl restart nomad<\/code><\/pre>\n<pre><code class=\"language-bash\">ls -al \/var\/log\/nomad\/<\/code><\/pre>\n<pre><code class=\"language-bash\">sudo tail -20 \/var\/log\/nomad\/nomad-1630127757917582936.log<\/code><\/pre>\n<h2>Docker \ub85c\uadf8 \ud655\uc778\ud558\uae30<\/h2>\n<p>\ub178\ub9c8\ub4dc \ub85c\uadf8\uc0c1\uc5d0 \ub3c4\ucee4 \uc0dd\uc131\uacfc \uc2e4\ud589 \ud6c4 \uc2e4\ud328\ud558\ub294 \ub85c\uadf8\uac00 \uc788\ub2e4\uba74 \ub3c4\ucee4\uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-hcl\">plugin &quot;docker&quot; {\n  config {\n    # \uc2e4\ud589 \uc2e4\ud328\uc2dc \uc774\ubbf8\uc9c0 \uc0ad\uc81c\n    # \ub514\ubc84\uae45\uc2dc false \ub85c \ud560\uac83\n    gc {\n      container   = true\n    }\n  }\n}<\/code><\/pre>\n<p>\uc704 nomad client server \uc758 \uc124\uc815\uc5d0\uc11c <code>container   = true<\/code> \ub97c <code>container   = false<\/code> \ub85c \ubcc0\uacbd\ud558\uba74 \ub3c4\ucee4\uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>nomad \ub85c\uadf8 \ud655\uc778\ud558\uae30 \ub178\ub9c8\ub4dc \ub85c\uadf8\ub294 \uc624\ub958\uac00 \ubc1c\uc0dd\ud55c \uc704\uce58\uc5d0 \ub530\ub77c, Application Level \uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\ub3c4, \ub610\ub294 nomad \uc790\uccb4\uc758 \ub85c\uadf8\ub97c \ud655\uc778\ud574\uc57c \ud558\ub294 \uacbd\uc6b0, \uadf8\ub9ac\uace0 Docker \ub97c \uc774\uc6a9\ud588\ub2e4\uba74 Docker \uc5d0\uc11c \ub85c\uadf8\ub97c \ud655\uc778\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \ubc1c\uc0dd\ud569\ub2c8\ub2e4. Application Log \ud655\uc778\ud558\uae30 nomad status ID Type Priority Status Submit Date autoscaler service 50 running 2021-08-28T12:17:52+09:00 grafana service 50 running 2021-08-28T12:08:54+09:00\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=3182\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-3182","post","type-post","status-publish","format-standard","hentry","category-nomad"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3182"}],"version-history":[{"count":7,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3182\/revisions"}],"predecessor-version":[{"id":3472,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3182\/revisions\/3472"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}