当前位置: 首页 > 知识库问答 >
问题:

Spring Boot Admin未解析健康和管理URL

易琛
2023-03-14
  • Spring版本:5.0.8。发布
  • Spring启动依赖项版本:2.0.4。发布
  • Java版本:1.8.0131

Spring Boot Admin报告客户端已关闭。不过,通过在浏览器中导航到客户端,我可以看到客户端正在运行。在Sprint Boot Admin中客户端的详细信息视图中,运行状况部分下的消息是“获取运行状况失败,网络错误”。详细信息页面的标题中显示了三个URL:

http://localhost:8090/WorkOrderPrinting
http://localhost:8090/WorkOrderPrinting/manage
http://localhost:8090/WorkOrderPrinting/manage/health

单击它们将打开相应的视图。以下是“运行状况”视图的输出:

{"status":"UP","details":{"diskSpace":{"status":"UP","details":{"total":80482930688,"free":77726302208,"threshold":10485760}},"db":{"status":"UP","details":{"tenantRoutingDataSource":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}},"userSetTenantRoutingDS":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}},"dataSourceCbCommon":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}},"dataSourceCbOrg":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}}}}}}

它似乎告诉我客户端应用程序已经启动并运行。所以我不知道为什么Sprint Boot Admin UI没有反映这一点。

我有一个作为客户机运行的第二个应用程序,它可以按预期工作。健康URL的结果是相同的。

{"status":"UP","details":{"diskSpace":{"status":"UP","details":{"total":80482930688,"free":77726248960,"threshold":10485760}},"db":{"status":"UP","details":{"tenantRoutingDataSource":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}},"userSetTenantRoutingDS":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}},"dataSourceCbCommon":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}},"dataSourceCbOrg":{"status":"UP","details":{"database":"Informix Dynamic Server","hello":104}}}}}}

Spring Boot Admin Server日志显示此工作订单打印错误。同样,不确定URL为什么工作,但日志显示错误。

2018-09-13 09:19:19.071 DEBUG 5208 --- [     parallel-2] d.c.b.a.server.services.StatusUpdater    : Update status for Instance(id=6212ad7c5ab4, version=1, registration=Registration(name=Work Order Printing Development, managementUrl=http://localhost:8090/WorkOrderPrinting/manage, healthUrl=http://localhost:8090/WorkOrderPrinting/manage/health, serviceUrl=http://localhost:8090/WorkOrderPrinting, source=http-api), registered=true, statusInfo=StatusInfo(status=DOWN, details={error=Found, status=302}), statusTimestamp=2018-09-13T13:15:08.169Z, info=Info(values={}), endpoints=Endpoints(endpoints={health=Endpoint(id=health, url=http://localhost:8090/WorkOrderPrinting/manage/health)}), buildVersion=null)

Spring启动管理服务器配置

server.servlet.context-path=/adminserver
logging.file=/var/log/eti/webui/adminserver.log
logging.level.de.codecentric.boot.admin.server=INFO

客户端配置失败

    #Admin Panel config
    #
    #This is the URL for the admin panel that this application will send its information to
    spring.boot.admin.client.url=http://localhost:8080/adminserver
    #This is required when deploying to Tomcat because the Admin panel cant seem to determine what the URL will be on its own 
    spring.boot.admin.client.instance.service-base-url=http://localhost:8090
    #This is the name that will be displayed in the admin panel for this application
    spring.boot.admin.client.instance.name=Work Order Printing
    # 
    spring.boot.admin.auto-registration=true
    #
    #Actuator config needed to expose endpoints to admin panel
    #
    management.endpoints.web.base-path=/manage
    management.endpoints.web.exposure.include:*
    management.endpoint.health.show-details=always

工作客户端配置

    #Admin Panel config
    #
    #This is the URL for the admin panel that this application will send its information to
    spring.boot.admin.client.url=http://localhost:8080/adminserver
    #This is required when deploying to Tomcat because the Admin panel cant seem to determine what the URL will be on its own 
    spring.boot.admin.client.instance.service-base-url=http://localhost:8085
    #This is the name that will be displayed in the admin panel for this application
    spring.boot.admin.client.instance.name=LaunchPad
    spring.boot.admin.auto-registration=true
    #
    #Actuator config needed to expose endpoints to admin panel
    #
    management.endpoints.web.base-path=/manage
    management.endpoints.web.exposure.include:*
    management.endpoint.health.show-details=always

共有1个答案

杜正奇
2023-03-14

所以问题最终变成了我这边的配置问题。管理服务器日志显示以下内容:

2018-09-13 09:19:19.071 DEBUG 5208 --- [     parallel-2] d.c.b.a.server.services.StatusUpdater    : Update status for Instance(id=6212ad7c5ab4, version=1, registration=Registration(name=Work Order Printing Development, managementUrl=http://localhost:8090/WorkOrderPrinting/manage, healthUrl=http://localhost:8090/WorkOrderPrinting/manage/health, serviceUrl=http://localhost:8090/WorkOrderPrinting, source=http-api), registered=true, statusInfo=StatusInfo(status=DOWN, details={error=Found, status=302}), statusTimestamp=2018-09-13T13:15:08.169Z, info=Info(values={}), endpoints=Endpoints(endpoints={health=Endpoint(id=health, url=http://localhost:8090/WorkOrderPrinting/manage/health)}), buildVersion=null)

它基本上是说,有一个302(重定向)发生,所以它无法到达的网址。原因是我忘了允许访问Spring Security配置中的URL。我可以通过浏览器找到他们,因为我已经登录了。Spring Boot Admin无法启动,因为它未登录。

我添加了一个允许访问/manage/url的规则

 public void configure(WebSecurity web) throws Exception
{
    web.ignoring().antMatchers("/css/**", "/fonts/**", "/img/**", "/js/**", "/close", "/webjars/**", "/manage/**");
}
 类似资料:
  • 设置-1:(不工作) 我有一个任务正在ECS集群中运行。但由于在它开始后立即进行了健康检查,它正在下降。 我的服务是基于spring boot的,它有流量(用于服务调用)和管理端口(用于健康检查)。我有“*/health”路径的“权限。 PFA:我也通过在TG运行状况检查选项卡中选择覆盖端口选项进行了相同的配置。 因此,我尝试在容器部分的任务定义上配置管理端口。我尝试为TD的最新版本更新相应的服务

  • 在设置ELB健康检查的对话框中,它会声明: 如果实例未通过健康检查,它将自动从负载均衡器中删除。自定义健康检查以满足您的特定需要。 当健康检查失败时,将从ELB后面删除实例。我的问题是围绕“健康门槛”设置。当你悬停在帮助上时,它会说: 在声明EC2实例健康之前连续运行状况检查成功的次数。 如果实例声明为健康的,它是否被拉回负载平衡组?

  • 我对弹性负载均衡器健康检查和亚马逊EC2健康检查有点困惑。 在将运行状况检查添加到自动缩放组中时,会显示: 如果已将一个或多个负载均衡器附加到自动缩放组,并且某个实例未通过负载均衡器运行状况检查,则默认情况下,自动缩放不会替换该实例。 如果启用负载均衡器运行状况检查,而某个实例未通过运行状况检查,则自动缩放将认为该实例不正常并替换它。 因此,如果我不启用ELB健康检查,EC2健康检查将起作用,如果

  • 在使用Gradle构建的一个简单的Spring Java项目中,我使用io.Spring.dependency-management应用BOM,该BOM应该在全局指定依赖版本。 现在在BOM中,我已经覆盖了jackson-databind(2.9.5)的默认版本,从Spring Boot2.0.2.Release到2.9.10.4版本。 我在dependencyManagement部分指定了这个B

  • Spring Cloud Stream为粘合剂提供健康指标。它以binders的名义注册,可以通过设置management.health.binders.enabled属性启用或禁用。