First download the latest installation package for zookeeper and unzip and copy the configuration file:
$ sudo tar xzvf zookeeper-3.4.6.tar.gz$ cd zookeeper-3.4.6$ sudo cp conf/zoo_sample.cfg conf/zoo.cfg
Next, open the configuration file zoo.cfg for editing:
$ sudo vim zoo.cfg
Add the following configuration (the following five items, in fact, from the zoo_sample.cfg copy came from, we just need to change the DataDir to their own directory):
ticktime=2000 #initLimit =10synclimit=5datadir=/home/dubbo/zookeeper-3.3.3/data #数据目录, can be any directory ClientPort =2181 #监听client连接的端口号
Even if the zookeeper is configured here. Starting the server requires only running scripts:
$ sudo./bin/zkserver.sh start
command to stop the service:
$ sudo./bin/zkserver.sh stop
After the service is running, you can connect to the server with the client:
$ sudo./bin/zkcli.sh-server localhost:2181
- Related articles recommended:
- How GitHub migrated the MySQL cluster
- Build high-availability clusters under CentOS 7
- RHEL 7 Feature description (vi): Cluster
- This article is from: Linux technology Network
- This article link: http://www.ahlinux.com/mainte/9585.html
Install Zookeeper (non-clustered) under Linux