问题描述
关于 Spring Boot Admin (SBA) 的小问题。
我可以很好地将客户端注册到 SBA 服务器,非常高兴。 不幸的是,服务器本身向自己注册。
SBA 的用途是监控和获取有关 SBA 客户端的信息。 我很难让 SBA 服务器不注册自己,而只是接受来自客户端的注册。
请问实现此目标的最佳方法是什么?
在我的应用中,我有:
@EnableScheduling
@EnableAdminServer
@EnableDiscoveryClient
@SpringBootApplication
public class MyApplication {
谢谢
解决方法
在您的管理服务器属性中,您可以使用 spring.boot.admin.discovery.services
属性专门将您想要监控的应用程序列入白名单,或者您可以使用 spring.boot.admin.discovery.ignored-services
属性将您不想要的任何应用程序列入黑名单进行监控。
就您而言,您可以:
spring.boot.admin.discovery.ignored-services:
- 'admin-server'
其中 admin-server 是您的管理服务器的 spring.application.name
。