No instances available for service-helloworld

问题描述:No instances available for service-helloworld

客户端注册不到注册中心,所以找不到对应的实例

解决方案

  1. 客户端加入依赖
<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-starter-eureka</artifactId>
   <version>1.4.5.RELEASE</version>
</dependency>

    2. 加入依赖之后springboot还要开启健康检查

   eureka.client.healthcheck.enabled=true

并且加入依赖

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

    3. 客户端启动之后能在注册中心看到实例才算启动成功

4 这样就可以用客户端远程调用服务端的方法了