Spring boot admin - 注册同一个应用的两个实例

Spring boot admin - register two instances of the same app

我想在 spring 引导管理服务器中注册同一应用程序的两个实例(只是端口不同)。但是我在 spring 引导管理面板中只看到一个实例(MyApp 实例 2)。我的配置有什么问题?

基本信息:

我的 application.yml 文件:

spring:
  boot:
    admin:
      client:
        url: http://example.org:7474/admin/
        instance:
          name: 'MyApp instance 1'
          service-url: http://example.org:7474/MyApp/
          service-base-url: http://example.org:7474/
          metadata:
            user.name: myuser
            user.password: mypassword
        instance:
          name: 'MyApp instance 2'
          service-url: http://example.org:27474/MyApp/
          service-base-url: http://example.org:27474/
          metadata:
            user.name: myuser
            user.password: mypassword
management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

目前 Spring Boot Admin Client 能够进行单一注册。

我认为注册同一个实例两次(正如您的配置试图做的那样)是相当不寻常的

如果您在每个实例中包含客户端以进行注册,它就可以工作。