4.将zookeeper-3.4.6拷贝到/usr/local/solrcloud下,复制三份分别并将目录名改为zookeeper1、zookeeper2、zookeeper3
5.进入zookeeper1文件夹,创建data目录。并在data目录中创建一个myid文件内容为“1”(echo 1 >> data/myid)。
6.进入conf文件夹,把zoo_sample.cfg改名为zoo.cfg
7.修改zoo.cfg
dataDir=/usr/local/solrcloud/zookeeper1/data
clientPort=2181(zookeeper2中为2182、zookeeper3中为2183)
添加:
server.1=192.168.198.130:2881:3881
server.2=192.168.198.130:2882:3882
server.3=192.168.198.130:2883:3883
8.对zookeeper2、3中的设置做第二步至第四步修改。
zookeeper2:
myid内容为2
dataDir=/usr/local/solrcloud/zookeeper2/data
clientPort=2182
Zookeeper3:
myid内容为3
dataDir=/usr/local/solrcloud/zookeeper3/data
clientPort=2183
9.启动三个zookeeper,查看状态
启动三个zookeeper /usr/local/solrcloud/zookeeper1/bin/zkServer.sh start /usr/local/solrcloud/zookeeper2/bin/zkServer.sh start /usr/local/solrcloud/zookeeper3/bin/zkServer.sh start 查看集群状态: /usr/local/solrcloud/zookeeper1/bin/zkServer.sh status /usr/local/solrcloud/zookeeper2/bin/zkServer.sh status /usr/local/solrcloud/zookeeper3/bin/zkServer.sh status
在 CentOS7 上安装 Zookeeper-3.4.9 服务