spring-cloud / spring-cloud-config

External configuration (server and client) for Spring Cloud
Apache License 2.0
1.95k stars 1.29k forks source link

When using zookeeper as the registry, config client cannot discover config ser through service ID #1560

Closed Dog4j closed 4 years ago

Dog4j commented 4 years ago

Hello When using zookeeper as the registry, config-client cannot discover config-server through service-id, configServer can only be called through spring.cloud.config.uri. configServer can register to ZK.

SpringCloudVersion: Hoxton.SR1 SpringBootVersion: 2.2.5.RELEASE zkVersion: 3.6.3

configServer conf: spring: cloud: zookeeper: discovery: enabled: true register: true root: /server instance-host: ${spring.cloud.client.ip-address} connect-string: zk1:2181,zk2:2182,zk3:2183 configClient conf: spring: cloud: config: name: account discovery: enabled: true service-id: config-center fail-fast: true retry: initial-interval: 3000 max-attempts: 20 max-interval: 5000 username: root password: 123456

Dog4j commented 4 years ago

Solved add spring.main.allow-bean-definition-overriding: true