服务注册到服务治理中心时自动关闭

该博客记录了在Spring Cloud中使用Eureka进行服务注册时遇到的问题。当服务启动后,服务注册到Eureka服务中心,但在短时间内自动关闭并注销,详细日志显示了从服务启动到注销的完整过程。这可能是由于配置问题导致的服务不稳定。
  • 控制台信息:
    2019-03-02 12:01:29.819 INFO 4320 — [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
    2019-03-02 12:01:29.835 INFO 4320 — [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
    2019-03-02 12:01:29.839 INFO 4320 — [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1551499289837 with initial instances count: 1
    2019-03-02 12:01:29.839 INFO 4320 — [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application EURKA-PROVIDER with eureka with status UP
    2019-03-02 12:01:29.840 INFO 4320 — [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1551499289840, current=UP, previous=STARTING]
    2019-03-02 12:01:29.841 INFO 4320 — [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_EURKA-PROVIDER/localhost:eurka-provider:7001: registering service…
    2019-03-02 12:01:29.850 INFO 4320 — [ main] c.example.demo.DemoProviderApplication : Started DemoProviderApplication in 10.908 seconds (JVM running for 12.813)
    2019-03-02 12:01:29.852 INFO 4320 — [ Thread-4] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application EURKA-PROVIDER with eureka with status DOWN
    2019-03-02 12:01:29.853 WARN 4320 — [ Thread-4] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1551499289853, current=DOWN, previous=UP]
    2019-03-02 12:01:29.856 INFO 4320 — [ Thread-4] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient …
    2019-03-02 12:01:29.856 INFO 4320 — [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_EURKA-PROVIDER/localhost:eurka-provider:7001 - registration status: 204
    2019-03-02 12:01:29.856 INFO 4320 — [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_EURKA-PROVIDER/localhost:eurka-provider:7001: registering service…
    2019-03-02 12:01:29.873 INFO 4320 — [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_EURKA-PROVIDER/localhost:eurka-provider:7001 - registration status: 204
    2019-03-02 12:01:29.874 INFO 4320 — [ Thread-4] com.netflix.discovery.DiscoveryClient : Unregistering …
    2019-03-02 12:01:29.878 INFO 4320 — [ Thread-4] com.netflix.discovery.DiscoveryClient : DiscoveryClient_EURKA-PROVIDER/localhost:eurka-provider:7001 - deregister status: 200
    2019-03-02 12:01:29.883 INFO 4320 — [ Thread-4] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient

Process finished with exit code 0

在依赖中加入:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值