单机搭建solr4.10.3和hadoop2.6.0实验环境(二)部署zookeeper集群

解压zookeeper,tar -zxvf zookeeper-3.4.6.tar.gz

将zookeeper-3.4.6拷贝到/opt下,复制三份分别并将目录名改为zookeeper1、zookeeper2、zookeeper3

//创建data目录
mkdir /opt/zookeeper1/data
mkdir /opt/zookeeper2/data
mkdir /opt/zookeeper3/data

echo 1 > /opt/zookeeper1/data/myid
echo 2 > /opt/zookeeper2/data/myid
echo 3 > /opt/zookeeper3/data/myid


cd /opt/zookeeper1/conf
cp zoo_sample.cfg zoo.cfg

//修改datadir如下
dataDir=/opt/zookeeper1/data

clientPort=2181(zookeeper2中为2182、zookeeper3中为2183)
在末尾添加这三项配置(注意:2881和3881分别是zookeeper之间通信的端口号、zookeeper之间选举使用的端口号。2181是客户端连接的端口号,别搞错了哦):
server.1=127.0.0.1:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883


cp /opt/zookeeper1/conf/zoo.cfg /opt/zookeeper2/conf/
cp /opt/zookeeper1/conf/zoo.cfg /opt/zookeeper3/conf/
//修改dataDir和clientPort对应值

/opt/zookeeper1/bin/zkServer.sh start
/opt/zookeeper2/bin/zkServer.sh start
/opt/zookeeper3/bin/zkServer.sh start

/opt/zookeeper1/bin/zkServer.sh status
/opt/zookeeper2/bin/zkServer.sh status
/opt/zookeeper3/bin/zkServer.sh status

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值