1. Pull off the mirror
docker pull zookeeper:3.4.9
2. Start the container and add the mapping
docker run --privileged=true -d --name zookeeper --publish 2181:2181 -d zookeeper:3.4.9
3. Check whether it is activated
docker ps
4. Enter the zookeeper container
docker exec -it 容器ID /bin/bash
cd bin/
zkCli.sh
- Use ls / to view registered services
- Use ls /services/service name/your service id to see the service just registered
- Use get /services/service name/your service id to see the relevant information of the service you just registered