spring boot admin无法从客户端获取信息

时间:2018-10-24 13:57:26

标签: spring spring-boot spring-cloud spring-boot-admin

曾经尝试设置启动管理服务器。与客户端实例的连接失败 在IOException - An established connection was aborted by the software in your host machine上,即使所有相关端点都可以访问(并且Spring Security不在类路径中)

在服务器启动时,我得到:

Couldn't retrieve status for Instance(id=91e01a92b3bf, version=0, registration=Registration(name=test, managementUrl=https://client-url:8080/actuator, healthUrl=https://client-url:8080/actuator/health, serviceUrl=https://client-url:8080/, source=discovery), registered=true, statusInfo=StatusInfo(status=UNKNOWN, details={}), statusTimestamp=2018-10-24T13:57:58.816657Z, info=Info(values={}), endpoints=Endpoints(endpoints={health=Endpoint(id=health, url=https://client-url:8080/actuator/health)}), buildVersion=null, tags=Tags(values={}))

管理员pom.xml

 <dependency>
  <groupId>de.codecentric</groupId>
  <artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-commons</artifactId>
  <version>2.0.1.RELEASE</version>
</dependency>

管理应用程序。yml,按admin docs

spring:
  cloud:
    discovery:
      client:
        simple:
          instances:
            test:
            - uri: https://client-url:8080
              metadata:
                management.context-path: /actuator

客户端application.yml

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: always
    metrics:
      enabled: true

管理服务器日志已充满org.apache.coyote.CloseNowException: Connection [74], Stream [21], This stream is not writable错误

1 个答案:

答案 0 :(得分:0)

在调试模式下运行admin / client将会提供更详细的日志,以确切的URL服务器试图击中什么以及客户端是否从服务器获取任何请求为依据。我遇到过类似的情况,这是因为Spring Boot Admin和Client应用程序之间存在版本差异。

确认healthUrl = https://client-url:8080/actuator/health给出200 OK响应。 如果不是,那么您可能想要更改以下客户端属性:

spring.boot.admin.client.api-path=/actuator

然后再次检查其是否给出200 OK响应。