- 创建名称为 cloud-provider-zk-payment8001
pom依赖,相比之前的pay模块,添加如下:
<!--zookeeper客户端-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
</dependency>
写yml ```yaml server: port: 8001
spring: application: name: cloud-payment-service cloud: zookeeper: connect-string: 192.168.219.131:2181
4. 主启动类
```java
@SpringBootApplication
@EnableDiscoveryClient
public class ZkOrderApplication {
public static void main(String[] args) {
SpringApplication.run(ZkOrderApplication.class, args);
}
}