eureka简单使用

使用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

当前注册的客户端

原文地址:https://www.cnblogs.com/myPrBB/p/12628116.html