Eureka服务注册
一:服务端
1:导入依赖
<!--Eureka服务端-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
2:在启动器上加注解 @EnableEurekaServer
3:配置application.yml文件
spring:
application:
name: eureka-service
eureka:
client:
service-url:
defaultZone: http://127.0.0.1:10086/eureka
二:客户端
1:导入依赖
<!--Eureka客户端-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
2:配置application.yml文件
eureka:
client:
service-url:
defaultZone: http://127.0.0.1:10086/eureka