Field registration in org.springframework.cloud.client.serviceregistry.ServiceRegistryAutoConfiguration$ServiceRegistryEndpointConfiguration required a single bean, but 2 were found:

Field registration in org.springframework.cloud.client.serviceregistry.ServiceRegistryAutoConfiguration$ServiceRegistryEndpointConfiguration required a single bean, but 2 were found:
- nacosRegistration: defined by method 'nacosRegistration' in class path resource [org/springframework/cloud/alibaba/nacos/NacosDiscoveryAutoConfiguration.class]
- eurekaRegistration: defined in BeanDefinition defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.class]

EUREKA切换NACOS时发现两个注册中心

解决方法:

 

spring:
  autoconfigure:
    exclude: org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration

  

 

posted on 2024-05-02 16:50  ~码铃薯~  阅读(35)  评论(0编辑  收藏  举报

导航