创建工作目录
1 | mkdir ~/DockerDesktop |
创建挂载目录
1 | mkdir node1 |
创建docker-compose.yml
1 | vim docker-compose.yml |
1 | version: '3' |
运行
1 | docker-compose up -d |
我们不难发现Zookeeper5成为了集群的leader,其他都都成为了follower
1 | Zookeeper5_1 | 2020-04-18 09:53:01,840 [myid:5] - INFO [QuorumPeer[myid=5](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@863] - Peer state changed: leading - broadcast |