{"id":640,"date":"2023-03-23T21:42:05","date_gmt":"2023-03-23T13:42:05","guid":{"rendered":""},"modified":"2023-03-23T21:42:05","modified_gmt":"2023-03-23T13:42:05","slug":"SpringCloud Eureka","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/640.html","title":{"rendered":"SpringCloud Eureka"},"content":{"rendered":"
\n
\u4e3aEureka\u670d\u52a1\u5668\u521b\u5efa\u7ec4\u4ef6<\/span> <\/code>\n <\/div>\n <\/code>\n <\/div>\n <\/body>
\n \u66f4\u65b0CurrencyCalculationService\u4ee5\u8fde\u63a5\u5230Eureka\u670d\u52a1\u5668<\/span>
\n \u5c06CurrencyExchangeService\u8fde\u63a5\u5230Eureka\u670d\u52a1\u5668<\/span>
\n \u914d\u7f6e\u529f\u80fd\u533a<\/span> <\/p>\n
\n Group<\/strong>\u540d\u79f0\u3002\u6211\u4eec\u63d0\u4f9b\u4e86
\n com.lidihuo.microservices\u3002<\/strong>\n <\/div>\n
\n Artifact id<\/strong>\u3002\u6211\u4eec\u63d0\u4f9b\u4e86
\n netflix-eureka-naming-server\u3002<\/strong>\n <\/div>\n <\/p>\n
\n Eureka Server\uff0cConfig Client\uff0cActuator\uff0c<\/strong>\u548c
\n DevTools\u3002<\/strong>\n <\/div>\n <\/p>\n
\n \u751f\u6210<\/strong> >\u6309\u94ae\u3002\u5b83\u4f1a\u4e0b\u8f7d\u4e00\u4e2a
\n zip <\/strong>\u6587\u4ef6\u3002\n <\/div>\n
\n \u63d0\u53d6<\/strong>\u8be5zip\u6587\u4ef6\u5e76\u5c06\u8be5\u6587\u4ef6\u5939\u7c98\u8d34\u5230Spring Tool Suite\u4e2d(STS)\u5de5\u4f5c\u533a\uff0c\u7136\u540e
\n \u5bfc\u5165<\/strong>\u3002\n <\/div>\n
\n netflix-eureka\u547d\u540d-\u670d\u52a1\u5668\u9879\u76ee<\/strong>->\u5b8c\u6210\n <\/div>\n <\/p>\n
\n NetflixEurekaNamingServerApplication.java <\/strong>\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528\u6ce8\u91ca
\n @EnableEurekaServer <\/strong>\u542f\u7528Eureka\u670d\u52a1\u5668\u3002\n <\/div>\n\r\npackage <\/span>com.lidihuo.microservices.netflixeurekanamingserver;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;\r\n@SpringBootApplication\r\n@EnableEurekaServer\r\npublic <\/span>class <\/span>NetflixEurekaNamingServerApplication \r\n{\r\npublic <\/span>static void <\/span>main(String[] args) {\r\nSpringApplication.run<\/span>(NetflixEurekaNamingServerApplication.class, args);\r\n}\r\n}\r\n<\/pre>\n
\n application.properties <\/strong>\u6587\u4ef6\u5e76\u914d\u7f6e
\n \u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\uff0c\u7aef\u53e3\uff0c<\/strong>\u548c
\n \u5c24\u91cc\u5361\u670d\u52a1\u5668<\/strong>\u3002\n <\/div>\n\r\nspring.application.name=netflix-eureka-naming-server\r\nserver.port=8761\r\neureka.client.register-with-eureka=false\r\neureka.client.fetch-registry=false\r\n<\/pre>\n
\n 8761 <\/strong>\u662fEureka\u670d\u52a1\u5668\u7684\u9ed8\u8ba4\u7aef\u53e3\u3002\n <\/div>\n
\n NetflixEurekaNamingServerApplication.java <\/strong>\u6587\u4ef6\u4f5c\u4e3aJava\u5e94\u7528\u7a0b\u5e8f\u3002\n <\/div>\n <\/p>\n
\n
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"SpringCloud Eurekazh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106],"tags":[],"class_list":["post-640","post","type-post","status-publish","format-standard","hentry","category-bc_springcloud_jc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/640"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=640"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/640\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}