SpringCloud(十六)Eureka Client启动后就关闭 Unregistering application xxx with eureka with status DOWN

springboot版本:

2.0.1.RELEASE

springcloud版本:

Finchley.RELEASE

 

日志:

2018-07-15 10:50:10.516  INFO 16952 --- [           main] c.x.springcloud.EurekaClientApplication  : Started EurekaClientApplication in 8.884 seconds (JVM running for 10.459)
2018-07-15 10:50:10.522  INFO 16952 --- [      Thread-23] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@4278284b: startup date [Sun Jul 15 10:50:05 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@6c80d78a
2018-07-15 10:50:10.522  INFO 16952 --- [      Thread-23] o.s.c.n.e.s.EurekaServiceRegistry        : Unregistering application eureka-client1 with eureka with status DOWN
2018-07-15 10:50:10.523  WARN 16952 --- [      Thread-23] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1531623010523, current=DOWN, previous=UP]
2018-07-15 10:50:10.524  INFO 16952 --- [      Thread-23] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2018-07-15 10:50:10.526  INFO 16952 --- [      Thread-23] com.netflix.discovery.DiscoveryClient    : Shutting down DiscoveryClient ...
2018-07-15 10:50:10.542  INFO 16952 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EUREKA-CLIENT1/localhost:eureka-client1:8080 - registration status: 204
2018-07-15 10:50:10.543  INFO 16952 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EUREKA-CLIENT1/localhost:eureka-client1:8080: registering service...
2018-07-15 10:50:10.547  INFO 16952 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EUREKA-CLIENT1/localhost:eureka-client1:8080 - registration status: 204
2018-07-15 10:50:10.548  INFO 16952 --- [      Thread-23] com.netflix.discovery.DiscoveryClient    : Unregistering ...
2018-07-15 10:50:10.553  INFO 16952 --- [      Thread-23] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EUREKA-CLIENT1/localhost:eureka-client1:8080 - deregister  status: 200
2018-07-15 10:50:10.564  INFO 16952 --- [      Thread-23] com.netflix.discovery.DiscoveryClient    : Completed shut down of DiscoveryClient
2018-07-15 10:50:10.565  INFO 16952 --- [      Thread-23] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-07-15 10:50:10.565  INFO 16952 --- [      Thread-23] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans

Process finished with exit code 0

 

在eureka-client中加入web包后解决

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

 

我理解的是不用web包只是一个java程序,所以运行后就停止了。具体原理,希望大家研究出来回复一下。

 

微信公众号与博客同时更新,敬请关注:

 
 
 
  • 23
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 17
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值