0

我有一个 spring boot 1.5.1 服务和一个 spring boot admin 2.0.1。

鉴于本文档( http://codecentric.github.io/spring-boot-admin/2.0.0/#monitoring-spring-boot-1.5.x),这些是兼容的。

这是我的客户端设置

我的入口点

@SpringBootApplication
public class Run {

    /**
     * Starts the application.
     * @param args the arguments to start the application.
     * @throws Exception if an error occurs.
     */
    public static void main(String[] args)
        throws Exception {
        SpringApplication.run(Run.class, args);
    }
}

构建.gradle

    dependencies { 
//other internal dependencies
        compile 'org.modelmapper:modelmapper:0.7.7'
        compile 'org.springframework.boot:spring-boot-starter-security:1.5.1.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-web:1.5.1.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-jdbc:1.5.1.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-data-redis:1.5.1.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-amqp:1.5.1.RELEASE'
        compile 'org.springframework.boot:spring-boot-actuator:1.5.1.RELEASE'
        compile('de.codecentric:spring-boot-admin-starter-client:1.5.7')
        compile 'org.postgresql:postgresql:9.4-1206-jdbc42'
        provided 'javax.servlet:javax.servlet-api:3.1.0'
        provided 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.1'
    }

应用程序.yml

management:
  security:
    enabled: false
spring:
  boot:
    admin:
      url: http://localhost:8080

对于服务器设置,我遵循这里的入门http://codecentric.github.io/spring-boot-admin/2.0.0/#_what_is_spring_boot_admin

笔记 :

  • 我认为服务器设置没问题,因为我可以将服务器注册到自己
  • 当我启动客户端时,没有任何关于 SBA 客户端的内容,即使我将“logging.level.de.codecentric.boot.admin:DEBUG”添加到我的 application.yml
  • 客户端没有在服务器的日志上注册失败
  • 我尝试使用随机字符串更改服务器 url 以查看是否会出现错误,但它没有告诉任何有关该问题的信息
  • 客户端上有一个 configure(httpSecurity) 覆盖

会出什么问题?在我看来,spring 根本没有启动客户端。

4

4 回答 4

0

对于您的 Boot 1.5.x 应用程序,您需要设置spring.boot.admin.api-path=instances. 见http://codecentric.github.io/spring-boot-admin/current/#monitoring-spring-boot-1.5.x

于 2018-07-12T07:18:18.580 回答
0

您可以尝试使用不同的属性吗?spring.boot.admin。客户端.url

于 2018-08-08T14:40:05.397 回答
0
management:
endpoints.web.exposure.include=*

将此添加到您的 application.yml 文件中

于 2019-08-28T05:56:06.070 回答
0

我使用弹簧 2.4

具有以下属性文件

对于管理员

服务器端口 = 9090

spring.application.name = adminServer


对于客户

spring.boot.admin.client.url = http://localhost:9090/

management.endpoints.web.exposure.include=*

spring.boot.admin.client.enabled=true

spring.boot.admin.client.auto-registration=true

spring.boot.admin.client.username=admin

spring.boot.admin.client.password=admin

于 2021-04-24T00:42:54.227 回答