SpringCloud Eureka - 简单的客户端没有注册

Lec*_*dal 3 spring-cloud netflix-eureka

我有一个Eureka服务器,我想在其中注册一个非常基本的SpringBoot服务.不幸的是,虽然我试图遵循我能找到的所有文章,但服务并没有注册.

此外,当我检查DiscoveryClient的描述(获得自动装配)时,我看到"Spring Cloud No-op DiscoveryClient",它建议(根据NoopDiscoveryClient.java源)找不到Eureka客户端库.

我在pom

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-netflix-eureka-client</artifactId>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

如果我是对的,应该确保适当的netflix库到位.@EnableEurekaClient注释存在.启动客户端时控制台上没有错误,Eureka Server控制台日志中没有任何有趣内容.

这是application.yml的配置:

    eureka:
      client:
        serviceUrl:
          defaultZone: ${vcap.services.eureka-service.credentials.uri:http://127.0.0.1:8761}/eureka/
Run Code Online (Sandbox Code Playgroud)

任何建议真的很受欢迎,因为我的想法已经用尽了:)

spe*_*ibb 9

http://start.spring.io是你的朋友.你需要使用初学者.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Brixton.M5</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)

<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)