无法将我的微服务添加为Eureka Client

时间:2019-08-31 13:15:00

标签: spring spring-boot microservices spring-cloud

我使用3个spring boot应用程序设置了一个示例微服务。发布我正在尝试将所有这些都连接到Eureka Server。 有3个spring boot应用程序Task-Display,Task-Repo和Task-Status-Repo。 任务显示与其他两个通信并检索数据。

现在问题出在“任务显示”之外,其他所有链接到eureka服务器。部署任务显示时出现以下错误

2019-08-31 18:43:00.055  INFO 15528 --- [tbeatExecutor-0] 
com.netflix.discovery.DiscoveryClient    : DiscoveryClient_TASK-DISPLAY- 
ME;/192.168.1.9:task-display-me;:8180 - Re-registering apps/TASK-DISPLAY- 
ME;
2019-08-31 18:43:00.055  INFO 15528 --- [tbeatExecutor-0] 
com.netflix.discovery.DiscoveryClient    : DiscoveryClient_TASK-DISPLAY- 
ME;/192.168.1.9:task-display-me;:8180: registering service...
2019-08-31 18:43:00.057  WARN 15528 --- [tbeatExecutor-0] 
c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failure with 
status code 400; retrying on another server if available
2019-08-31 18:43:00.059  WARN 15528 --- [tbeatExecutor-0] 
c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failure with 
status code 400; retrying on another server if available
2019-08-31 18:43:00.060  WARN 15528 --- [tbeatExecutor-0] 
com.netflix.discovery.DiscoveryClient    : DiscoveryClient_TASK-DISPLAY- 
ME;/192.168.1.9:task-display-me;:8180 - registration failed Cannot execute 
request on any known server

com.netflix.discovery.shared.transport.TransportException: Cannot execute 
request on any known server

这是我的服务器Application.java,未链接到Eureka

   @SpringBootApplication
   @EnableEurekaClient
public class TaskDisplayApplication {



    public static void main(String[] args) {
        SpringApplication.run(TaskDisplayApplication.class, args);
    }


    @LoadBalanced
    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

}

0 个答案:

没有答案