- 控制台信息:
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>
该博客记录了在Spring Cloud中使用Eureka进行服务注册时遇到的问题。当服务启动后,服务注册到Eureka服务中心,但在短时间内自动关闭并注销,详细日志显示了从服务启动到注销的完整过程。这可能是由于配置问题导致的服务不稳定。
1218

被折叠的 条评论
为什么被折叠?



