使用eureka需要导入此依赖,作为注册中心服务器

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
application.yml中基本属性:

除了配置服务器外,还需要在客户端注入依赖才能让eureka服务器找到

eureka客户端

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

这样,访问

localhost:5000

当前注册的客户端

 


posted on 2020-04-03 18:06  ha1998  阅读(166)  评论(0编辑  收藏  举报