查看: 160|回复: 0

[Java代码] JEESZ-Zookeeper集群安装

发表于 5 天前
太阳http代理AD
1. 在根目录创建zookeeper文件夹(service1、service2、service3都创建)
[root@localhost /]# mkdir zookeeper
通过Xshell上传文件到service1服务器:上传zookeeper-3.4.6.tar.gz到/software文件夹

2.远程copy将service1下的/software/zookeeper-3.4.6.tar.gz到service2、service3
[root@localhost software]# scp -r /software/zookeeper-3.4.6.tar.gz root@192.168.2.212:/software/
[root@localhost software]# scp -r /software/zookeeper-3.4.6.tar.gz root@192.168.2.213:/software/
3.copy /software/zookeeper-3.4.6.tar.gz到/zookeeper/目录(service1、service2、service3都执行)
[root@localhost software]# cp /software/zookeeper-3.4.6.tar.gz /zookeeper/
4.安装解压zookeeper-3.4.6.tar.gz(service1、service2、service3都执行)
[root@localhost /]# cd /zookeeper/
[root@localhost zookeeper]# tar -zxvf zookeeper-3.4.6.tar.gz
5.在/zookeeper创建两个目录:zkdata、zkdatalog(service1、service2、service3都创建)
[root@localhost zookeeper]# mkdir zkdata
[root@localhost zookeeper]# mkdir zkdatalog
6.进入/zookeeper/zookeeper-3.4.6/conf/目录
[root@localhost zookeeper]# cd /zookeeper/zookeeper-3.4.6/conf/
[root@localhost conf]# ls
configuration.xsl  log4j.properties  zoo.cfg  zoo_sample.cfg
7. 修改zoo.cfg文件
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/zookeeper/zkdata
dataLogDir=/zookeeper/zkdatalog
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.2.211:12888:13888
server.2=192.168.2.212:12888:13888
server.3=192.168.2.213:12888:13888
8. 同步修改service2、service3的zoo.cfg配置
分布式的一些解决方案,有愿意了解的朋友可以找我们团队探讨
愿意了解框架技术或者源码的朋友直接求求交流分享技术:2042849237
更多详细源码参考来源:http://minglisoft.cn/technology



太阳http代理AD
回复

使用道具 举报