Java 在SBA-UI-环境中刷新上下文SBA客户端后,状态显示为“关闭”

Java 在SBA-UI-环境中刷新上下文SBA客户端后,状态显示为“关闭”,java,spring-boot,microservices,spring-boot-admin,Java,Spring Boot,Microservices,Spring Boot Admin,在SpringBootAdmin中,首先注册rest服务(SBA客户端),并可以查看所有信息。 但当我在“环境”选项卡中更新yaml属性后尝试刷新上下文时,虽然服务已启动,但服务状态仍在下降。 能够在localhost:portnumber/actuator/health中查看状态为UP 上述服务正在向eureka discovery注册 使用基本身份验证对服务进行身份验证。 在bootstarp属性/yaml中,提供以下字段: spring.boot.admin.client.instance

在SpringBootAdmin中,首先注册rest服务(SBA客户端),并可以查看所有信息。 但当我在“环境”选项卡中更新yaml属性后尝试刷新上下文时,虽然服务已启动,但服务状态仍在下降。 能够在localhost:portnumber/actuator/health中查看状态为UP

  • 上述服务正在向eureka discovery注册
  • 使用基本身份验证对服务进行身份验证。 在bootstarp属性/yaml中,提供以下字段: spring.boot.admin.client.instance.metadata.user.name=username spring.boot.admin.client.instance.metadata.user.password=password
  • 以下是eureka discovery的日志:

    c.n.e.registry.AbstractInstanceRegistry  : Registered instance service-name/service-name:152307399 with status UP (replication=false)
    c.n.e.registry.AbstractInstanceRegistry  : Registered instance service-name/service-name:152307399 with status UP (replication=true)
    c.n.e.registry.AbstractInstanceRegistry  : Cancelled instance service-name/service-name:152307399 (replication=false)
    c.n.e.registry.AbstractInstanceRegistry  : Registered instance service-name/service-name:680805597 with status UP (replication=false)
    c.n.e.registry.AbstractInstanceRegistry  : DS: Registry: cancel failed because Lease is not registered for: service-name/service-name:152307399
    c.n.eureka.resources.InstanceResource    : Not Found (Cancel): service-name - service-name:152307399
    INFO [-,b94f117edd71e6da,b94f117edd71e6da,false] 17648 --- [nio-8761-exec-1] c.n.e.registry.AbstractInstanceRegistry  : Registered instance service-name/service-name:680805597 with status UP (replication=true)
    c.n.eureka.cluster.ReplicationTask       : The replication of task service-name/service-name:152307399:Cancel@localhost failed with response code 404
    c.netflix.eureka.cluster.PeerEurekaNode  : service-name/service-name:152307399:Cancel@localhost: missing entry.
    
    下面是Spring引导管理日志

     INFO 16348 --- [ctor-http-nio-2] d.c.b.admin.server.services.InfoUpdater  : Couldn't retrieve info for Instance(id=1iu7yh611233, version=3, registration=Registration(name=service-name, managementUrl=http://abc2zcompany.com:12345/actuator, healthUrl=http://abc2zcompany.com:12345/actuator/health, serviceUrl=http://abc2zcompany.com:12345/, source=http-api), registered=true, statusInfo=StatusInfo(status=UP, details={hystrix={status=UP}, diskSpace={status=UP, details={total=298596691968, free=248679415808, threshold=10485760}}, configServer={status=UP, details={propertySources=[file:/D:/service-name.yml]}}, refreshScope={status=UP}, discoveryComposite={status=UP, details={discoveryClient={status=UP, details={services=[]}}, eureka={description=Remote status from Eureka server, status=UNKNOWN, details={applications={}}}}}, db={status=UP, details={defaultDs={status=UP, details={database=Oracle, hello=1}}}}}), statusTimestamp=2020-09-05T14:52:37.316Z, info=Info(values={}), endpoints=Endpoints(endpoints={httptrace=Endpoint(id=httptrace, url=http://abc2zcompany.com:12345/actuator/httptrace), loggers=Endpoint(id=loggers, url=http://abc2zcompany.com:12345/actuator/loggers), refresh=Endpoint(id=refresh, url=http://abc2zcompany.com:12345/actuator/refresh), health=Endpoint(id=health, url=http://abc2zcompany.com:12345/actuator/health), env=Endpoint(id=env, url=http://abc2zcompany.com:12345/actuator/env), heapdump=Endpoint(id=heapdump, url=http://abc2zcompany.com:12345/actuator/heapdump), features=Endpoint(id=features, url=http://abc2zcompany.com:12345/actuator/features), mappings=Endpoint(id=mappings, url=http://abc2zcompany.com:12345/actuator/mappings), scheduledtasks=Endpoint(id=scheduledtasks, url=http://abc2zcompany.com:12345/actuator/scheduledtasks), archaius=Endpoint(id=archaius, url=http://abc2zcompany.com:12345/actuator/archaius), configprops=Endpoint(id=configprops, url=http://abc2zcompany.com:12345/actuator/configprops), beans=Endpoint(id=beans, url=http://abc2zcompany.com:12345/actuator/beans), threaddump=Endpoint(id=threaddump, url=http://abc2zcompany.com:12345/actuator/threaddump), metrics=Endpoint(id=metrics, url=http://abc2zcompany.com:12345/actuator/metrics), conditions=Endpoint(id=conditions, url=http://abc2zcompany.com:12345/actuator/conditions), auditevents=Endpoint(id=auditevents, url=http://abc2zcompany.com:12345/actuator/auditevents), service-registry=Endpoint(id=service-registry, url=http://abc2zcompany.com:12345/actuator/service-registry), jolokia=Endpoint(id=jolokia, url=http://abc2zcompany.com:12345/actuator/jolokia), info=Endpoint(id=info, url=http://abc2zcompany.com:12345/actuator/info)}), buildVersion=null, tags=Tags(values={})): 401
     INFO 16348 --- [ctor-http-nio-5] d.c.b.admin.server.services.InfoUpdater  : Couldn't retrieve info for Instance(id=1iu7yh611233, version=4, registration=Registration(name=service-name, managementUrl=http://abc2zcompany.com:12345/actuator, healthUrl=http://abc2zcompany.com:12345/actuator/health, serviceUrl=http://abc2zcompany.com:12345/, source=http-api), registered=true, statusInfo=StatusInfo(status=DOWN, details={error=Unauthorized, status=401}), statusTimestamp=2020-09-05T14:53:05.140Z, info=Info(values={}), endpoints=Endpoints(endpoints={httptrace=Endpoint(id=httptrace, url=http://abc2zcompany.com:12345/actuator/httptrace), loggers=Endpoint(id=loggers, url=http://abc2zcompany.com:12345/actuator/loggers), health=Endpoint(id=health, url=http://abc2zcompany.com:12345/actuator/health), refresh=Endpoint(id=refresh, url=http://abc2zcompany.com:12345/actuator/refresh), env=Endpoint(id=env, url=http://abc2zcompany.com:12345/actuator/env), heapdump=Endpoint(id=heapdump, url=http://abc2zcompany.com:12345/actuator/heapdump), features=Endpoint(id=features, url=http://abc2zcompany.com:12345/actuator/features), scheduledtasks=Endpoint(id=scheduledtasks, url=http://abc2zcompany.com:12345/actuator/scheduledtasks), mappings=Endpoint(id=mappings, url=http://abc2zcompany.com:12345/actuator/mappings), archaius=Endpoint(id=archaius, url=http://abc2zcompany.com:12345/actuator/archaius), beans=Endpoint(id=beans, url=http://abc2zcompany.com:12345/actuator/beans), configprops=Endpoint(id=configprops, url=http://abc2zcompany.com:12345/actuator/configprops), threaddump=Endpoint(id=threaddump, url=http://abc2zcompany.com:12345/actuator/threaddump), metrics=Endpoint(id=metrics, url=http://abc2zcompany.com:12345/actuator/metrics), conditions=Endpoint(id=conditions, url=http://abc2zcompany.com:12345/actuator/conditions), auditevents=Endpoint(id=auditevents, url=http://abc2zcompany.com:12345/actuator/auditevents), service-registry=Endpoint(id=service-registry, url=http://abc2zcompany.com:12345/actuator/service-registry), info=Endpoint(id=info, url=http://abc2zcompany.com:12345/actuator/info), jolokia=Endpoint(id=jolokia, url=http://abc2zcompany.com:12345/actuator/jolokia)}), buildVersion=null, tags=Tags(values={})): 401
     INFO 16348 --- [ctor-http-nio-3] d.c.b.admin.server.services.InfoUpdater  : Couldn't retrieve info for Instance(id=1iu7yh611233, version=5, registration=Registration(name=service-name, managementUrl=http://abc2zcompany.com:12345/actuator, healthUrl=http://abc2zcompany.com:12345/actuator/health, serviceUrl=http://abc2zcompany.com:12345/, source=http-api), registered=true, statusInfo=StatusInfo(status=DOWN, details={error=Unauthorized, status=401}), statusTimestamp=2020-09-05T14:53:05.140Z, info=Info(values={}), endpoints=Endpoints(endpoints={httptrace=Endpoint(id=httptrace, url=http://abc2zcompany.com:12345/actuator/httptrace), loggers=Endpoint(id=loggers, url=http://abc2zcompany.com:12345/actuator/loggers), refresh=Endpoint(id=refresh, url=http://abc2zcompany.com:12345/actuator/refresh), health=Endpoint(id=health, url=http://abc2zcompany.com:12345/actuator/health), env=Endpoint(id=env, url=http://abc2zcompany.com:12345/actuator/env), heapdump=Endpoint(id=heapdump, url=http://abc2zcompany.com:12345/actuator/heapdump), mappings=Endpoint(id=mappings, url=http://abc2zcompany.com:12345/actuator/mappings), scheduledtasks=Endpoint(id=scheduledtasks, url=http://abc2zcompany.com:12345/actuator/scheduledtasks), configprops=Endpoint(id=configprops, url=http://abc2zcompany.com:12345/actuator/configprops), threaddump=Endpoint(id=threaddump, url=http://abc2zcompany.com:12345/actuator/threaddump), metrics=Endpoint(id=metrics, url=http://abc2zcompany.com:12345/actuator/metrics), auditevents=Endpoint(id=auditevents, url=http://abc2zcompany.com:12345/actuator/auditevents), jolokia=Endpoint(id=jolokia, url=http://abc2zcompany.com:12345/actuator/jolokia), info=Endpoint(id=info, url=http://abc2zcompany.com:12345/actuator/info)}), buildVersion=null, tags=Tags(values={})): 401
    
    

    请任何人帮我解决这个问题,提前谢谢。

    您是否使用随机密码访问致动器端点?刷新上下文时密码是否会更改,但在SBA中不会更新?不,只需从yaml文件检索单个密码(加密)。Sba客户端(rest微服务)正在使用基本身份验证。问题在于经过身份验证的服务。当我为eureka discovery(无身份验证)服务启用SBA时,即使在刷新上下文后也会正确注册。非常感谢。