当前位置:   article > 正文

Eureka快速启动_本地快速启动euraka工具

本地快速启动euraka工具

1.导入依赖

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/

开启eureka功能

@EnableEurekaServer

遇到的问题

Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

问题解决 

没有开启自动配置功能

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/酷酷是懒虫/article/detail/839020
推荐阅读
相关标签
  

闽ICP备14008679号