centOS系统下zookeeper集群部署
2015-09-10 14:52
579 查看
1、Install
将zookeeper.XXX.tar.gz 解压到指定的路径,如/usr/local/src
2、config
我们集群中提供相同应用的服务群称为quorum,其中的每台机器都有相同的配置文件
2.1)mkdir -p /var/zookeeper/data (可以指定系统中分配较大的空间分区)
2.2)编辑config文件(安装根目录下的conf目录下)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.
dataDir=/tmp/zookeeper
maxClientCnxns=100
# the port at which the clients will connect
clientPort=2181
server.1=服务ip:2555:3555
server.2=服务ip:2555:3555
server.3=服务ip:2555:3555
其中server.x代表整个集群的机器,当服务启动时,会在数据目录(上面的data目录)下
查找命名位myid的文件。
2.3)配置myid文件
在数据目录下创建名为myid(不要带任何扩展属性)的文件,根据server.x在对应的
ip机器上的myid文件中填入对应的编号(譬如,server123.1,则在ip为server123的
机器上的myid文件中填上1)
3、注意配置centOS上的防火墙端口
查看防火墙状态 service iptables status
关闭防火墙 service iptables stop
或者通过配置文件方式添加对应的端口(鉴于篇幅不赘述)
4、启动集群中的机器
三台主机执行 zkServer.sh start启动,注意三台启动的间隔时间
不要太长(因为有超时设定)
将zookeeper.XXX.tar.gz 解压到指定的路径,如/usr/local/src
2、config
我们集群中提供相同应用的服务群称为quorum,其中的每台机器都有相同的配置文件
2.1)mkdir -p /var/zookeeper/data (可以指定系统中分配较大的空间分区)
2.2)编辑config文件(安装根目录下的conf目录下)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.
dataDir=/tmp/zookeeper
maxClientCnxns=100
# the port at which the clients will connect
clientPort=2181
server.1=服务ip:2555:3555
server.2=服务ip:2555:3555
server.3=服务ip:2555:3555
其中server.x代表整个集群的机器,当服务启动时,会在数据目录(上面的data目录)下
查找命名位myid的文件。
2.3)配置myid文件
在数据目录下创建名为myid(不要带任何扩展属性)的文件,根据server.x在对应的
ip机器上的myid文件中填入对应的编号(譬如,server123.1,则在ip为server123的
机器上的myid文件中填上1)
3、注意配置centOS上的防火墙端口
查看防火墙状态 service iptables status
关闭防火墙 service iptables stop
或者通过配置文件方式添加对应的端口(鉴于篇幅不赘述)
4、启动集群中的机器
三台主机执行 zkServer.sh start启动,注意三台启动的间隔时间
不要太长(因为有超时设定)
相关文章推荐
- CentOS 6.6下PXE+Kickstart无人值守安装操作系统
- Linux性能分析和工具)
- linux 下校对服务器时间
- [转][技巧]linux命令行解压小技巧一例
- Linux编译提速
- linux SVN常见问题解决
- 三张图看遍Linux性能监控、测试、优化工具
- Linux和windows下内核socket优化项
- linux命令备份和还原mysql数据库
- Linux Valgrind命令
- CentOS6.5下DNS服务器搭建与配置
- linux安装包制作
- linux_常用压缩,解压缩命令
- PXE+kickstart实现自动安装centOS6.5
- 在windows上模拟linux环境
- linux mysql迁移
- Linux下C/C++ 目录和文件操作
- Linux Purify命令
- Centos6修改时区
- linux 环境下安装SVN服务器