赞
踩
2.编写配置文件
3.开启这个功能
4.配置类(通常需要,启动eureka不需要)
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka-server</artifactId> <version>1.4.7.RELEASE</version> </dependency>
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/
@EnableEurekaServer
Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
没有开启自动配置功能
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。