2.编写配置文件
3.开启这个功能
4.配置类(通常需要,启动eureka不需要)
导入依赖编写配置文件org.springframework.cloud spring-cloud-starter-eureka-server1.4.7.RELEASE
server:
port: 7001
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false #表示eureka是否向注册中心注册自己
fetch-registry: false #false表示自己是注册中心
service-url: #服务url地址
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
开启eureka功能
遇到的问题@EnableEurekaServer
Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
问题解决没有开启自动配置功能



