一:引入
<!--eureka服务端--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency>
二:添加@EnableEurekaServer注解
package cn.itcast.eureka; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @EnableEurekaServer @SpringBootApplication public class EurekaApplication { // psvm public static void main(String[] args){ SpringApplication.run(EurekaApplication.class, args); } }
三:在application.yaml中配置相关信息
server: port: 10086 spring: application: name: eurekaserver #eureka的服务名称 eureka: client: service-url: #eureka的地址信息 defaultZone: http://127.0.0.1:10086/eureka
四:启动
标签:springframework,eureka,import,org,Eureka,server,cloud,搭建 From: https://www.cnblogs.com/zsbb/p/16895399.html