gpt4 book ai didi

java - Eureka 服务器的问题

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:24:55 27 4
gpt4 key购买 nike

我有一个本地的 Eureka 服务器和一个客户端

Eureka :

server:
port: 1111

eureka:
instance:
prefer-ip-address: true
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://127.0.0.1:1111/eureka/
server:
waitTimeInMsWhenSyncEmpty: 0

客户:

eureka:
instance:
prefer-ip-address: true
client:
serviceUrl:
defaultZone: http://127.0.0.1:1111/eureka/

我有两个问题:

1)Eureka服务器抛出日志:

NullPointerException: at com.netflix.eureka.resources.StatusResource.isReplicaAvailable

2) 客户端与 Eureka 连接,但一段时间后我在他的日志中看到下一个:

RedirectingEurekaHttpClient : Request execution error javax.ws.rs.WebApplicationException: null at com.netflix.discovery.provider.DiscoveryJerseyProvider.readFrom(DiscoveryJerseyProvider.java:110)

RetryableEurekaHttpClient : Request execution failure DiscoveryClient : DiscoveryClient_MW/192.168.0.100:client:8080 - was unable to send heartbeat!

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

在日志 Eureka 中我看到:

InstanceRegistry : DS: Registry: lease doesn't exist, registering resource: CLIENT - 192.168.0.100:client:8080 InstanceResource : Not Found (Renew): CLIENT - 192.168.0.100:client:8080

在 Eureka web console 中,客户端有一个 UP 状态,而且还有一个大铭文:

RENEWALS ARE LESSER THAN THE THRESHOLD. THE SELF PRESERVATION MODE IS TURNED OFF.THIS MAY NOT PROTECT INSTANCE EXPIRY IN CASE OF NETWORK/OTHER PROBLEM

虽然连接正常,但我可以通过 Eureka 获得到我的客户端的链接。

你能解释一下它的含义以及我如何摆脱它吗?

最佳答案

serviceUrl:
defaultZone: http://127.0.0.1:1111/eureka/

在客户端设置YML中,你应该像这样在“defaultZone”之前添加空格:

serviceUrl:
defaultZone: http://127.0.0.1:1111/eureka/

else defaultZone 与 serviceUrl 同级别。谢谢

关于java - Eureka 服务器的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37187327/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com