将服务注册到Eureka服务器时出错 [英] Error registering service to eureka server

查看:1146
本文介绍了将服务注册到Eureka服务器时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将客户端注册到spring-eureka-server,客户端在注册后立即注销

I am trying to register a client to spring-eureka-server, client deregisters just after registering

eureka服务器日志:

eureka-server logs:

2018-05-13 16:02:47.290信息25557 --- [io-9091-exec-10] c.n.e.registry.AbstractInstanceRegistry:已注册的实例 HELLO-CLIENT/192.168.43.96:hello-client:8072,状态为UP (replication = false)2018-05-13 16:02:47.438信息25557- [nio-9091-exec-3] c.n.e.registry.AbstractInstanceRegistry: 注册实例HELLO-CLIENT/192.168.43.96:hello-client:8072与 状态DOWN(replication = false)2018-05-13 16:02:47.457 INFO 25557 --- [nio-9091-exec-2] c.n.e.registry.AbstractInstanceRegistry:取消的实例HELLO-CLIENT/192.168.43.96:hello-client:8072 (replication = false)2018-05-13 16:02:47.950信息25557- [nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry: 注册实例HELLO-CLIENT/192.168.43.96:hello-client:8072与 状态DOWN(replication = true)2018-05-13 16:02:47.951 INFO 25557 --- [nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry:已取消 实例HELLO-CLIENT/192.168.43.96:hello-client:8072 (replication = true)2018-05-13 16:03:25.747信息25557- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry:正在运行 补偿时间为4ms的逐出任务

2018-05-13 16:02:47.290 INFO 25557 --- [io-9091-exec-10] c.n.e.registry.AbstractInstanceRegistry : Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with status UP (replication=false) 2018-05-13 16:02:47.438 INFO 25557 --- [nio-9091-exec-3] c.n.e.registry.AbstractInstanceRegistry : Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with status DOWN (replication=false) 2018-05-13 16:02:47.457 INFO 25557 --- [nio-9091-exec-2] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance HELLO-CLIENT/192.168.43.96:hello-client:8072 (replication=false) 2018-05-13 16:02:47.950 INFO 25557 --- [nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry : Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with status DOWN (replication=true) 2018-05-13 16:02:47.951 INFO 25557 --- [nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance HELLO-CLIENT/192.168.43.96:hello-client:8072 (replication=true) 2018-05-13 16:03:25.747 INFO 25557 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 4ms

Eureka客户端日志:

Eureka-client logs:

2018-05-13 16:02:47.163信息25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient: DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072: 正在注册服务... 2018-05-13 16:02:47.212信息25676 --- [
main] c.a.helloclient.HelloClientApplication:已启动 HelloClientApplication在7.62秒内运行(JVM运行8.573) 2018-05-13 16:02:47.224信息25676 --- [Thread-5] s.c.a.AnnotationConfigApplicationContext:关闭 org.springframework.context.annotation.AnnotationConfigApplicationContext@6f7923a5: 启动日期[美国标准时间2018年5月13日16:02:42];父母: org.springframework.context.annotation.AnnotationConfigApplicationContext@5c30a9b0 2018-05-13 16:02:47.226信息25676 --- [Thread-5] o.s.c.n.e.s.EurekaServiceRegistry:取消注册应用程序 带有eureka的hello客户端状态为DOWN 2018-05-13 16:02:47.227 WARN 25676 --- [Thread-5] com.netflix.discovery.DiscoveryClient :看到本地状态更改事件StatusChangeEvent [timestamp = 1526207567227,current = DOWN,Previous = UP] 2018-05-13 16:02:47.232 INFO 25676 --- [Thread-5] o.s.c.support.DefaultLifecycleProcessor:在阶段0停止bean 2018-05-13 16:02:47.235 INFO 25676 --- [Thread-5] com.netflix.discovery.DiscoveryClient:关闭 DiscoveryClient ... 2018-05-13 16:02:47.292信息25676- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient: DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072- 注册状态:204 2018-05-13 16:02:47.423 INFO 25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient: DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072: 正在注册服务... 2018-05-13 16:02:47.440 INFO 25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient: DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072- 注册状态:204 2018-05-13 16:02:47.442 INFO 25676 --- [
线程5] com.netflix.discovery.DiscoveryClient:正在取消注册... 2018-05-13 16:02:47.460信息25676 --- [Thread-5] com.netflix.discovery.DiscoveryClient: DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072- 取消注册状态:200 2018-05-13 16:02:47.494信息25676 --- [
线程5] com.netflix.discovery.DiscoveryClient:已关闭 的DiscoveryClient 2018-05-13 16:02:47.495 INFO 25676 --- [
线程5] o.s.j.e.a.AnnotationMBeanExporter:正在取消注册 关闭时JMX暴露的豆2018-05-13 16:02:47.498 INFO 25676 --- [线程5] o.s.j.e.a.AnnotationMBeanExporter: 取消注册JMX暴露的bean

2018-05-13 16:02:47.163 INFO 25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072: registering service... 2018-05-13 16:02:47.212 INFO 25676 --- [
main] c.a.helloclient.HelloClientApplication : Started HelloClientApplication in 7.62 seconds (JVM running for 8.573) 2018-05-13 16:02:47.224 INFO 25676 --- [ Thread-5] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@6f7923a5: startup date [Sun May 13 16:02:42 IST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@5c30a9b0 2018-05-13 16:02:47.226 INFO 25676 --- [ Thread-5] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application hello-client with eureka with status DOWN 2018-05-13 16:02:47.227 WARN 25676 --- [ Thread-5] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1526207567227, current=DOWN, previous=UP] 2018-05-13 16:02:47.232 INFO 25676 --- [ Thread-5] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0 2018-05-13 16:02:47.235 INFO 25676 --- [ Thread-5] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ... 2018-05-13 16:02:47.292 INFO 25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 - registration status: 204 2018-05-13 16:02:47.423 INFO 25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072: registering service... 2018-05-13 16:02:47.440 INFO 25676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 - registration status: 204 2018-05-13 16:02:47.442 INFO 25676 --- [
Thread-5] com.netflix.discovery.DiscoveryClient : Unregistering ... 2018-05-13 16:02:47.460 INFO 25676 --- [ Thread-5] com.netflix.discovery.DiscoveryClient : DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 - deregister status: 200 2018-05-13 16:02:47.494 INFO 25676 --- [
Thread-5] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient 2018-05-13 16:02:47.495 INFO 25676 --- [
Thread-5] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown 2018-05-13 16:02:47.498 INFO 25676 --- [ Thread-5] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans

请让我知道可能出了什么问题.

Please let me know what could be possibly wrong.

推荐答案

看起来像是一个依赖项.

Looks like a dependency issue.

如果该应用在没有eureka集成的情况下可以正常运行(核心功能),请尝试更改eureka-client依赖版本.

If the app works fine (the core functionality) without eureka integration, then try changing the eureka-client dependency version.

这篇关于将服务注册到Eureka服务器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆