Spring Cloud中Eureka Client启动后就关闭 Unregistering application xxx with eureka with status DOWN

Spring Boot版本:2.1.3.RELEASE
Spring Cloud版本:Greenwich.SR1

日志:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Discovery Client initialized at timestamp 1553267512406 with initial instances count: 0
Registering application spring-cloud-producer with eureka with status UP
Saw local status change event StatusChangeEvent [timestamp=1553267512410, current=UP, previous=STARTING]
DiscoveryClient_SPRING-CLOUD-PRODUCER/LT-YEZHOU.lianlianpay.com:spring-cloud-producer:9000: registering service...
Started SpringCloudProducerApplication in 5.759 seconds (JVM running for 7.087)
Unregistering application spring-cloud-producer with eureka with status DOWN
Saw local status change event StatusChangeEvent [timestamp=1553267512430, current=DOWN, previous=UP]
Shutting down DiscoveryClient ...
DiscoveryClient_SPRING-CLOUD-PRODUCER/LT-YEZHOU.lianlianpay.com:spring-cloud-producer:9000 - registration status: 204
DiscoveryClient_SPRING-CLOUD-PRODUCER/LT-YEZHOU.lianlianpay.com:spring-cloud-producer:9000: registering service...
DiscoveryClient_SPRING-CLOUD-PRODUCER/LT-YEZHOU.lianlianpay.com:spring-cloud-producer:9000 - registration status: 204
Unregistering ...
DiscoveryClient_SPRING-CLOUD-PRODUCER/LT-YEZHOU.lianlianpay.com:spring-cloud-producer:9000 - deregister status: 200
Completed shut down of DiscoveryClient

Process finished with exit code 0

在eureka-client中加入web依赖后解决

1
2
3
4
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

不用web包只是一个Java程序,所以运行后就停止了。

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :