{"id":5649,"date":"2022-06-29T15:49:57","date_gmt":"2022-06-29T06:49:57","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5649"},"modified":"2022-07-01T14:05:49","modified_gmt":"2022-07-01T05:05:49","slug":"spring-cloud-config-%ec%84%9c%eb%b2%84-%ea%b5%ac%ec%84%b1%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5649","title":{"rendered":"Spring Cloud Config \uc11c\ubc84\/\ud074\ub77c\uc774\uc5b8\ud2b8 \uad6c\uc131\ud558\uae30"},"content":{"rendered":"<h1>Spring Cloud Config \uc11c\ubc84\/\ud074\ub77c\uc774\uc5b8\ud2b8 \uad6c\uc131\ud558\uae30<\/h1>\n<p>application.yaml \ub85c \uc124\uc815\uc744 \ud558\uac8c \ub418\uba74,<br \/>\n\uc124\uc815\uc774 \ubcc0\uacbd\ub420 \ub54c\ub9c8\ub2e4 \uc11c\ubc84\ub97c \uc7ac\uc2dc\uc791\ud574\uc57c \ud558\ub294 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud55c\ub2e4.<\/p>\n<p>\uc774\ub97c \ud574\uacb0\ud558\uae30 \uc704\ud574 Spring Boot 2.4 \ubd80\ud130\ub294 Config Server \uac00 \uc0dd\uacbc\ub2e4.<br \/>\nConfig Server \uc5d0 \uc124\uc815\uc744 \ud574\ub450\uace0,<br \/>\n\uc11c\ubc84\uc5d0\uc11c Config Server \uc5d0 \uc124\uc815\uc744 \uac31\uc2e0\ud558\ub3c4\ub85d \ud558\uba74 \uc11c\ubc84 \uc7ac\uc2dc\uc791 \uc5c6\uc774<br \/>\n\uc124\uc815\uc774 \uac31\uc2e0\ub41c\ub2e4.<\/p>\n<h2>Config Server \uad6c\uc131\ud558\uae30<\/h2>\n<p>\uc544\ub798 \uc758\uc874\uc131\ub9cc \uc788\uc73c\uba74 \ub41c\ub2e4.<\/p>\n<pre><code class=\"language-build.gradle\">dependencies {\n    implementation (&#039;org.springframework.cloud:spring-cloud-config-server&#039;)\n}<\/code><\/pre>\n<p><code>@EnableConfigServer<\/code> \ub9cc \ucd94\uac00\ud558\ub294 \uac83\uc73c\ub85c \uc124\uc815\uc774 \ub05d\ub09c\ub2e4.<\/p>\n<pre><code class=\"language-java\">@EnableConfigServer\n@SpringBootApplication\npublic class ConfigServerApplication {\n\n   public static void main(String[] args) {\n      SpringApplication.run(ConfigServerApplication.class, args);\n   }\n}<\/code><\/pre>\n<h2>\uc124\uc815\ud30c\uc77c \uad00\ub9ac\ud558\uae30<\/h2>\n<p>\uc124\uc815\ud30c\uc77c\uc740 \ubcc4\ub3c4\uc758 git repo \uc5d0 \uc62c\ub824\ub193\uace0 \uac00\uc838\uc62c \uc218\ub3c4 \uc788\ub2e4.<\/p>\n<p><a href=\"https:\/\/github.com\/XXXXXX\/spring-cloud-config-example\">https:\/\/github.com\/XXXXXX\/spring-cloud-config-example<\/a> \ub77c\ub294 private repo \uac00 \uc788\ub2e4\uace0 \uac00\uc815\ud558\uc790.<\/p>\n<p>\uc704 repo \uc5d0 \uc544\ub798 \ub450\uac1c\uc758 \ud30c\uc77c\uc744 \uc62c\ub9ac\uc790.<\/p>\n<p>config-example-default.yml<\/p>\n<pre><code class=\"language-yaml\">example:\n  phase: &quot;default&quot;<\/code><\/pre>\n<p>config-example-release.yml<\/p>\n<pre><code class=\"language-yaml\">example:\n  phase: &quot;release&quot;<\/code><\/pre>\n<p>Config Server \uc758 application.yml \uc744 \uc5f4\uace0,<br \/>\n\uc544\ub798 \ub0b4\uc6a9\uc744 \ucd94\uac00\ud574 \uc900\ub2e4.<\/p>\n<pre><code class=\"language-yaml\">spring:\n  cloud:\n    config:\n      server:\n        git:\n          uri: git@github.com:XXXXXX\/spring-cloud-config-example.git<\/code><\/pre>\n<p>\uc778\uc99d \ubc29\uc2dd\uc740 Personal Access Token \uc73c\ub85c \ud574\uc900\ub2e4.(<a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=3563\">\ucc38\uc870<\/a>)<\/p>\n<h2>\uc811\uc18d\ud655\uc778<\/h2>\n<p><a href=\"http:\/\/localhost:8080\/config-example\/default\">http:\/\/localhost:8080\/config-example\/default<\/a> \uc5d0 \uc811\uc18d\ud574 \ubcf8\ub2e4.<br \/>\n<del><a href=\"http:\/\/XXX.XXX.XXX.XXX:8888\/default,elastic,token,rabbitmq,redis,eureka\/local\">http:\/\/XXX.XXX.XXX.XXX:8888\/default,elastic,token,rabbitmq,redis,eureka\/local<\/a><\/del><\/p>\n<h2>Config Client \uad6c\uc131\ud558\uae30<\/h2>\n<p>application.yml<\/p>\n<pre><code class=\"language-yaml\">spring:\n  application:\n    name: config-example<\/code><\/pre>\n<p>Config Client \ub294 \ub514\ud3f4\ud2b8\ub85c Config Server \ub97c <a href=\"http:\/\/localhost:8888\">http:\/\/localhost:8888<\/a> \uc5d0\uc11c \ucc3e\ub294\ub2e4.<br \/>\n\ud638\uc2a4\ud2b8\ub098 \ud3ec\ud2b8\ub97c \ubcc0\uacbd\ud588\ub2e4\uba74 \uc544\ub798 \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\uace0 \ub0b4\uc6a9\uc744 \uc785\ub825\ud574 \uc900\ub2e4.<\/p>\n<p>bootstrap.yml<\/p>\n<pre><code class=\"language-yaml\">spring:\n  cloud:\n    config:\n      uri: http:\/\/localhost:8080<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Spring Cloud Config \uc11c\ubc84\/\ud074\ub77c\uc774\uc5b8\ud2b8 \uad6c\uc131\ud558\uae30 application.yaml \ub85c \uc124\uc815\uc744 \ud558\uac8c \ub418\uba74, \uc124\uc815\uc774 \ubcc0\uacbd\ub420 \ub54c\ub9c8\ub2e4 \uc11c\ubc84\ub97c \uc7ac\uc2dc\uc791\ud574\uc57c \ud558\ub294 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud55c\ub2e4. \uc774\ub97c \ud574\uacb0\ud558\uae30 \uc704\ud574 Spring Boot 2.4 \ubd80\ud130\ub294 Config Server \uac00 \uc0dd\uacbc\ub2e4. Config Server \uc5d0 \uc124\uc815\uc744 \ud574\ub450\uace0, \uc11c\ubc84\uc5d0\uc11c Config Server \uc5d0 \uc124\uc815\uc744 \uac31\uc2e0\ud558\ub3c4\ub85d \ud558\uba74 \uc11c\ubc84 \uc7ac\uc2dc\uc791 \uc5c6\uc774 \uc124\uc815\uc774 \uac31\uc2e0\ub41c\ub2e4. Config Server \uad6c\uc131\ud558\uae30 \uc544\ub798 \uc758\uc874\uc131\ub9cc \uc788\uc73c\uba74 \ub41c\ub2e4. dependencies {\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5649\">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":[29],"tags":[],"class_list":["post-5649","post","type-post","status-publish","format-standard","hentry","category-spring-boot-2-5"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5649","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=5649"}],"version-history":[{"count":4,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5649\/revisions"}],"predecessor-version":[{"id":5659,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5649\/revisions\/5659"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}