Three machines, IP respectively 192.168.1.231, 192.168.1.232, 192.168.1.233
Tools used: SECURECRT, WinSCP
SECURECRT for connecting machines, executing commands
WinSCP for uploading files to machines
Premise: The machine installs the SSH service.
Download zookeeper-3.3.5.tar.gz, upload to the 231 machine using WINSCP, assuming the path is/home/grid/soft/
Use SECURECRT, execute command tar-zxvf zookeeper-3.3.5.tar.gz, unzip file
MV zookeeper-3.3.5 Zookeeper
Establish a soft connection (shortcut), Ln-s Zookeeper-3.3.5/zookeeper, this step is not necessary, just to facilitate later operation, and replace the zookeeper version does not need to modify the directory
CD zookeeper/conf
Modify file name
MV Zoo_sample.cfg Zoo.cfg
VI zoo.cfg
Modify the DataDir path, because the default temp path, after the system restarts, the data is emptied
Modified: Datadir=/home/grid/soft/zookeeper/datadir
After the file, add the following configuration:
server.1=192.168.1.231:2888:3888
server.2=192.168.1.232:2888:3888
server.3=192.168.1.233:2888:3888
Create DataDir:
CD Zookeeper
mkdir DataDir
Echo 1 > myID
Execute the following command to copy the file to the 232, 233 machine:
SCP-RQ zookeeper/192.168.1.232:/home/grid/soft/
SCP-RQ zookeeper/192.168.1.233:/home/grid/soft/
Log in to 232, 233 machines, enter the DataDir directory, change the value of myID to 2, 3, respectively
On the 231, 232, 233 machines, execute the following command to start zookeeper:
zkserver.sh start
On the 231, 232, 233 machines, perform the following commands to view the Zookeeper boot status:
zkserver.sh status
Zookeeper Cluster construction