zookeeper安装包_Linux部署Zookeeper

1.下载Zookeeper安装包,上传到服务器中:https://zookeeper.apache.org/

2.创建Zookeeper主机用户(按需)

useradd zookeeper echo “zookeeper:${pwd}” |chpasswd

3.创建zookeeper的dataDir、dataLogDir目录:

mkdir -p /home/zookeeper/${dataDir}   /home/zookeeper/{$dataLogdir}
4d5d037f56440746f99fcb9324b65f3c.png

4.在${zookeeper_install_path}/conf/下创建:zoo.cnf配置文件,添加如下内容:

# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial# synchronization phase can takeinitLimit=10# The number of ticks that can pass between# sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just# example sakes.dataDir=${dataDir}dataLogDir=${dataLogdir}# the port at which the clients will connectclientPort=${port}# the maximum number of client connections.# increase this if you need to handle more clientsmaxClientCnxns=300## Be sure to read the maintenance section of the# administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDirautopurge.snapRetainCount=10# Purge task interval in hours# Set to "0" to disable auto purge featureautopurge.purgeInterval=60server.1=*.*.*.*:${sync_port1}:${sync_port2}server.2=*.*.*.*:${sync_port1}:${sync_port2}server.3=*.*.*.*:${sync_port1}:${sync_port2}

5.按需修改zoo.cnf配置文件,clientPort、dataDir、dataLogDir、server1.server2.server3......

6.在${zookeeper_install_path}/bin/zkEnv.sh文件中添加如下信息(3.6.2版本),不启动export

export JVMFLAGS=" -Dzookeeper.admin.enableServer=false $JVMFLAGS"

7.在zoo.cnf配置文件中,dataDir路径下添加myid文件,如上,内容为zoo.cnf配置文件server.1中的数字1。

8.把配置好的zookeeper包,打包后拷贝到其它服务器上,并修改myid

tar -zcvf ${tar.gz_name_file} ${zookeeper_path}

9.分别启动zookeeper节点:

${/home/zookeeper/}/bin/ ./zkServer.sh start

10.zookeeper添加ACL访问权限:

addauth digest ${username}:${passwd}setAcl /${path} auth:${username}:${passwd}:cdrwa#访问:addauth digest ${username}:${passwd}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值