gpt4 book ai didi

Cloud Foundry 上的 Spring-Boot-Admin : Showing UP applications as OFFLINE

转载 作者:行者123 更新时间:2023-12-04 09:01:01 24 4
gpt4 key购买 nike

我们正在使用提供的以代码为中心的库 spring-boot-admin-server 开发 Boot-Admin 仪表板。版本 1.4.5

一些应用程序通过 Eureka 向服务器注册自己,一些直接使用 spring-boot-admin-starter-client版本 1.4.5。

所有组件都部署在 PCF 环境中,并通过 HTTPS 进行通信。无论哪种方式,应用程序虽然能够向管理服务器注册自己,但仅显示为离线。任何组件的日志中都没有报告错误,即。管理员服务器、管理员客户端、 Eureka 服务器、 Eureka 客户端。

然而,唯一显示为 Up 的应用程序是管理服务器本身。

在 PCF 中运行的 spring-boot-admin-client 应用程序的应用程序属性是:

spring:
application:
name: bootadmin-ms-charlie
boot:
admin:
url: https://bootadmin-dashboard.abc.intl.com

ssl:
trust_store:
path: classpath:ssl/sslcacert.jks
password: a-password

由于两种注册方法的结果相同,为了保持简单,我跳过了将配置放在此处用于通过 Eureka 路径注册的应用程序。

同样在本地工作得很好,管理仪表板按预期显示所有应用程序。

是否需要针对 Cloud Foundry 进行任何配置?
或者我可能犯了任何明显的错误?

任何建议都是最受欢迎的。

---编辑---

以下是来自 SBA 服务器的日志,显示服务器和客户端之间的通信正常。如果这些日志给出任何错误迹象,请指出。
OUT 2017-01-23 05:15:15.139 DEBUG 10 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : DispatcherServlet with name 'dispatcherServlet' processing POST request for [/api/applications]
OUT 2017-01-23 05:15:15.151 DEBUG 10 --- [nio-8080-exec-1] m.m.a.RequestResponseBodyMethodProcessor : Read [class de.codecentric.boot.admin.model.Application] as "application/json;charset=UTF-8" with [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@7df33a9f]
OUT 2017-01-23 05:15:15.163 DEBUG 10 --- [nio-8080-exec-1] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Written [Application [id=3805ee6a, name=bootadmin-ms-charlie, managementUrl=http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080, healthUrl=http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080/health, serviceUrl=http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080]] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@7df33a9f]
OUT 2017-01-23 05:15:15.166 DEBUG 10 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
OUT 2017-01-23 05:15:15.166 DEBUG 10 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Successfully completed request
OUT bootadmin-dashboard.abc-intl.com - [23/01/2017:05:15:15.140 +0000] "POST /api/applications HTTP/1.1" 201 302 308 "-" "Java/1.8.0_121" 60.16.25.20:43224 x_forwarded_for:"10.10.10.10" x_forwarded_proto:"https" vcap_request_id:a40159e4-543f-40e0-627e-e8f1e7688b99 response_time:0.034164523 app_id:adcc8a33-83f4-448d-9ae2-bf2a2b16ea72
OUT 2017-01-23 05:15:18.719 DEBUG 10 --- [ updateTask1] o.s.web.client.RestTemplate : Created GET request for "http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080/health"
OUT 2017-01-23 05:15:18.722 DEBUG 10 --- [ updateTask1] o.s.web.client.RestTemplate : Setting request Accept header to [application/json, application/*+json]

来自客户端的日志都是干净的。仅当服务器关闭时,它才会发出“无法重新注册”的警告。

最佳答案

基于 https://github.com/codecentric/spring-boot-admin/issues/399 上的讨论已经发现以下属性对于 SBA 客户在 Cloud Foundry 或基于容器的架构上使用 Dashboard 至关重要:
spring:
boot:
admin:
client:
management-url: <complete management-url for the client>
health-url: <complete health endpoint url for the client>
service-url: <complete root/service url for the client>

这是因为,当客户端向
SBA 服务器它使用 runC容器 ID 以形成其服务 url。此类 url 对 Cloud Foundry 路由器无效。这会导致稍后 SBA 仪表板与客户端之间的通信失败,导致其显示为 OFFLINE。

另一种方法是继续使用容器 IP,使用 spring.boot.admin.client.prefer-ip=true .这将列出 SBA 上的所有容器/CF instacnes,但不会从站点/AZ 提供完整应用程序的整体健康状况的清晰画面。此外,根据云原生应用程序和 12 因素的原则,CF 中从不鼓励直接连接到容器。

关于Cloud Foundry 上的 Spring-Boot-Admin : Showing UP applications as OFFLINE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41742918/

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