添加依赖
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency>
启动类添加 @EnableEurekaClient
配置:
server.port=8081
eureka.client.service-url.defaultZone=http://localhost:8080/eureka/
spring.application.name=recommend-rikaze
启动效果图: