是否有一种方法可以通过配置将特定的IP地址列入黑名单,从而避免在Spring Eureka云发现中注册为微服务?似乎每次我重新启动发现服务时,都无法识别的ip实例正在注册为微服务。从所附的图像中,我希望仅存在一个实例,而不是所示的两个实例。
当前,application.yml文件的配置如下:
---
# This default profile is used when running a single instance completely standalone:
#spring:
# profiles: default
server:
port: 8010
eureka:
instance:
hostname: eurekahost
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
security:
basic:
enabled: false
user:
name: user # login username
password: password