Note: If you have problems installing, scroll down to see if you missed a step
Go to the official website to download ZooKeeper, I downloaded the old version:
After decompression, we get:
Open and create two new folders, data and log:
Open conf folder:
把
zoo_sample.cfg
Make a copy and rename it tozoo.cfg
.
Open zoo. CFG with the editor, I used nodepad++, and set dataDir=… Change that line to:
DataDir = your ZooKeeper installation directory \data dataLogDir= your ZooKeeper installation directory \logCopy the code
After that, go back to the bin folder:
Then open zkServer.cmd with an editor:
You should see something like this at the end of the code:
Change it to:
In other words,
endlocal
Add a sentence to the previous linepause
And thencall %JAVA%
tojava
:
After that, we double-click zkserver.cmd:
You will see:
It’s not a mistake! It’s not a mistake! It’s not a mistake! The server has been started successfully. Don’t move this page! Now double-click zkcli.cmd again:
You will see:
At this time, the client has been successfully started, you can enter the command, enter:
ls/
Copy the code
or
help
Copy the code
You will see:This is zooKeeper’s help command. Congratulations!