zookeeper 简单配置
pom 文件 <!--spring 整合 zookeeper 客户端 --> <dependency> <groupId> org.springframework.cloud </groupId> <artifactId> spring-cloud-starter-zookeeper-discovery </artifactId> </dependency> 配置文件 server : port : 80 spring : application : name : cloud-order-service cloud : zookeeper : connect-string : 192.168.1.147:2181 启动类 @EnableDiscoveryClient @SpringBootApplication public class OrderZK80 { public static void main (String[] args) { SpringApplication. run (OrderZK80. class, args) ; } } 来源: oschina 链接: https://my.oschina.net/u/4253180/blog/4321287