Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Linux下安装Zookeeper集群

$
0
0

与大家分享下linux下安装zookeeper集群的过程步骤,希望有所帮助。首先,准备三台Linux虚拟机

三台机器 CentOS01 :192.168.1.168 ( lxs001 ) centos03 : 192.168.1.178 ( lxs003 ) centos03 : 192.168.1.188 ( lxs003 ) 三台机器


Linux下安装Zookeeper集群

下载zookeeper :

进入 opt 目录

下载zookeeper:wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz

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


Linux下安装Zookeeper集群
Linux下安装Zookeeper集群
Linux下安装Zookeeper集群

zookeeper-3.4.6改名成zookeeper: mv zookeeper-3.4.6 zookeeper


Linux下安装Zookeeper集群

进入conf目录 配置文件 cp 拷贝一个zoo.cfg备份


Linux下安装Zookeeper集群

编辑zoo.cfg:Vim zoo.cfg


Linux下安装Zookeeper集群
改为
Linux下安装Zookeeper集群

增加集群信息

server.1=192.168.1.168:2888:3888

server.2=192.168.1.178:2888:3888

server.3=192.168.1.188:2888:3888


Linux下安装Zookeeper集群

将在168上配置好的zoo.cfg拷贝 到 178 188两台机器上

scp zoo.cfg root@192.168.1.178:/opt/zookeeper/conf


Linux下安装Zookeeper集群

配置 dataDir:刚才dataDir 为 /var/zookeeper

进入 var, mkdir 新建 zookerper文件夹


Linux下安装Zookeeper集群

vim myid 新建 myid 文本 编辑myid文本并且写上 service 后的数字,


Linux下安装Zookeeper集群

同时在178 188 上同样创建个 myid,分别写上2,3

以上配置好了就可以连接测试zookeeper了,cd进入 /opt/zookeeper/bin目录,启动


Linux下安装Zookeeper集群

telnet 192.168.1.168 2181

如果没装 telnet 先装下


Linux下安装Zookeeper集群

重新连接 成功后输入stat


Linux下安装Zookeeper集群

同时启动 178 188服务器

有时候 集群不是 ,可能是机器上防火墙没有关闭,在三台机器上分别关闭防火墙


Linux下安装Zookeeper集群

最后 三台机器集群起来就是下面这个


Linux下安装Zookeeper集群
Linux下安装Zookeeper集群

ZooKeeper学习总结 http://www.linuxidc.com/Linux/2016-07/133179.htm

Ubuntu 14.04安装分布式存储Sheepdog+ZooKeeper http://www.linuxidc.com/Linux/2014-12/110352.htm

CentOS 6安装sheepdog 虚拟机分布式储存 http://www.linuxidc.com/Linux/2013-08/89109.htm

ZooKeeper集群配置 http://www.linuxidc.com/Linux/2013-06/86348.htm

使用ZooKeeper实现分布式共享锁 http://www.linuxidc.com/Linux/2013-06/85550.htm

分布式服务框架 ZooKeeper -- 管理分布式环境中的数据 http://www.linuxidc.com/Linux/2013-06/85549.htm

ZooKeeper集群环境搭建实践 http://www.linuxidc.com/Linux/2013-04/83562.htm

ZooKeeper服务器集群环境配置实测 http://www.linuxidc.com/Linux/2013-04/83559.htm

ZooKeeper集群安装 http://www.linuxidc.com/Linux/2012-10/72906.htm

Zookeeper3.4.6的安装 http://www.linuxidc.com/Linux/2015-05/117697.htm

本文永久更新链接地址 : http://www.linuxidc.com/Linux/2017-01/139545.htm


Viewing all articles
Browse latest Browse all 11063

Trending Articles