简体   繁体   中英

How to use Apache ZooKeeper with Spring Cloud service discovery and load balancing?

I'm new to Apache ZooKeeper concept to implement the service discovery and load balancing with netflix ribbon client. I seen some examples in github ( https://github.com/spring-cloud/spring-cloud-zookeeper ). Could anyone help me to know how to set-up the ZooKeeper and service discovery implementation on app service instances. I'm very curious to know about this concept.

Thanks in advance..,

For today ( in March 2018 ) you should use Zookeeper Dependencies .

  • Add dependency org.springframework.cloud:spring-cloud-starter-zookeeper-discovery ;

  • Setting up Zookeeper Dependencies

     spring: # your app name application.name: app cloud.zookeeper: discovery: root: /path/to/your/dependencies enabled: true dependencies: dependencyOne: # absolute path is /path/to/your/dependencies/dependencyOne path: /dependencyOne loadBalancerType: ROUND_ROBIN required: false stubs: org.springframework:foo:stubs dependency.resttemplate.enabled: false 

See more in spring-cloud docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM