zookeeper 安装

Zookeeper安装

一、下载zookeeper

http://www.apache.org/dist/zookeeper/stable/

二、解压zookeeper.tar

>> tar xvf zookeeper-3.4.6.tar.gz

三、配置zoo.cfg

>> cp zoo_sample.cfg zoo.cfg

>> vim zoo.cfg

dataDir=/data/zookeeper

dataLogDir=/var/log/zookeeper

server.1=lv-master:2888:3888

server.2=lv-slave01:2888:3888

server.3=lv-slave02:2888:3888

四、创建data和log目录(其它机器相同操作)

>> mkdir –p /data/zookeeper

>> mkdir =p /var/log/zookeeper

>> chmod 777 /data/zookeeper

>> chmod 777 /var/log/zookeeper r

>> cd /data/zookeeper

>> vim myid

其它机器上的与zoo.cfg配置的相一致

五、添加环境变量

export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.6

PATH=$ZOOKEEPER_HOME/bin:$PATH

>> source /etc/profile

六、拷贝到其它机器

>> scp /etc/profile@lv-slave02:/etc/

>> scp -r zookeeper-3.4.6/ @lv-slave02:/usr/local/

七、启动zookeeper

>> zkServer.sh start

>> zkServer.sh status

你可能感兴趣的:(zookeeper 安装)