(using dobbo, start docker zookeeper) docker linux zookeeper installation

docker linux zookeeper installation

 

1. Download the zookeeper image

docker search zookeeper
docker pull zookeeper



  

 

2. Start

docker run -d --name zookeeper2 -p 2181:2181 zookeeper



  

 

3. View the startup log

docker logs -f zookeeper

 



 

 

4. docker start client

docker run  -it --rm --link zookeepe3:zookeeper zookeeper zkCli.sh -server zookeeper

 

 

 

5. Common zk commands

1. Display the root directory and files: ls / Use the ls command to view the content contained in the current ZooKeeper
2. Display the root directory and files: ls2 / View the current node data and see the update times and other data
3. Create the file and set the initial content: create /zk "test" creates a new znode "zk" and the string associated with it
4. Get the file content: get /zk to confirm whether the znode contains the string we created
5. Modify the content of the file: set /zk "zkbak" Set the string associated with zk
6. Delete the file: delete /zk delete the znode just created
7. Exit the client: quit
8. Help command: help




 

 

  

 

 

6. Use dubbo dubbox to use docker zookeeper, remember to add external network mapping

firewall-cmd --permanent --add-port=2181/tcp
firewall-cmd --reload
firewall-cmd --list-all

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Donate to developers 

Driven by interest, I write 免费something with joy and sweat. I hope you like my work and can support it at the same time. Of course, if you have money to support a money field (support Alipay, WeChat, and the buckle group), if you have no money to support a personal field, thank you.

 

Personal homepage : http://knight-black-bob.iteye.com/



 
 
 Thank you for your sponsorship, I will do better!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326224830&siteId=291194637