码迷,mamicode.com
首页 > 编程语言 > 详细

spring cloud eureka之客户端

时间:2018-05-19 23:52:39      阅读:296      评论:0      收藏:0      [点我收藏+]

标签:eureka   client   

依赖

<dependencies>
   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
   </dependency>
   <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
   </dependency>
       <dependency>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-actuator</artifactId>
       </dependency>
</dependencies>

启动类增加注解

@SpringBootApplication
@EnableEurekaClient
public class SpringWebDemoApplication {

   public static void main(String[] args) {
      SpringApplication.run(SpringWebDemoApplication.class, args);
   }
}

配置文件

eureka.instance.appname=web-demo
eureka.instance.app-group-name=web
eureka.instance.prefer-ip-address=true
eureka.instance.ip-address=127.0.0.1
eureka.instance.instance-id= ${spring.application.name}:${server.port}
#eureka.instance.home-page-url-path=/
#eureka.instance.health-check-url-path=/health
#eureka.instance.status-page-url-path=/status
eureka.instance.lease-expiration-duration-in-seconds=30
eureka.instance.lease-renewal-interval-in-seconds=10

eureka.client.serviceUrl.defaultZone=http://localhost:19002/eureka/,http://localhost:19001/eureka/

技术分享图片

spring cloud eureka之客户端

标签:eureka   client   

原文地址:http://blog.51cto.com/881206524/2118309

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!