1、apache官方下载,

2、新版本需要jdk环境,然后配置好jdk环境

3、解压zookeeper,进入解压后的conf,新建zoo.cfg (删掉自带的cfg)内容如下

tickTime=2000
initLimit=5
syncLimit=2
dataDir=/usr/local/zookeeper/server1/data
dataLogDir=/usr/local/zookeeper/server1/dataLog
clientPort=2181
server.1=node1:2888:3888
server.2=node2:2889:3889
server.3=node3:2890:3890

4、检查配置文件里面的datalog 和data 目录是否存在,不然后面启动会报错

5、在每个节点的data目录新建myid文件,并将id值写进去。。。。不然好多报错。按上面配置文件 举个栗子(echo "1" > /usr/local/zookeeper/data/myid) 节点1 就是1, 2就是2

6、启动zookeeper

./zkServer.sh start

启动这个的时候,会在当前路径生产nohup 的一个日志文件,不明白的可看nohup命令

7、查看zookeeper状态 和 在集群种的角色

./zkServer.sh status

启动成功后,可查看本地端口。

2888表示zookeeper程序监听端口,3888表示zookeeper选举通信端口。

之前版本的错误排查

Error contacting service. It is probably not running错误,在网上找了集中解决办法:
  1,打开zkServer.sh 找到
status)
    STAT=`echo stat | nc localhost $(grep clientPort "$ZOOCFG" | sed -e 's/.*=//') 2> /dev/null| grep Mode`
在nc与localhost之间加上 -q 1 (是数字1而不是字母l)
如果已存在则去掉
注:在我的zkServer.sh脚本文件里根本没有这一行,所以没有生效

2,
调用sh zkServer.sh status
遇到这个问题。百度,google了后发现有人是修改sh脚本里的一个nc的参数来解决,可在3.4.6的sh文件里并没有找到nc的调用。配置文档里指
定的log目录没有创建导致出错,手动增加目录后重启,问题解决。
注:我想不是日志的问题所以这个方法根本就没有试

3,创建数据目录,也就是在你zoo.cfg配置文件里dataDir指定的那个目录下创建myid文件,并且指定id,改id为你zoo.cfg文件中server.1=localhost:2887:3887中的1.只要在myid头部写入1即可.
注:这是我的解决办法

centos install zookeeper cluster的更多相关文章

  1. 安装 zookeeper cluster

    安装 zookeeper cluster zookeeper-3.4.5.tar.gz n0 10.69.10.193 n1 10.69.10.188 n2 10.69.10.192 n0 上解压 z ...

  2. fluidity install on Cluster

    fluidity install on Cluster 1.编译器安装 gcc4.6 openmpi python HOME_PATH= /hpcdata1/xiaozhong/ 1.1.gmp &a ...

  3. CentOS 7 install slurm cluster

    //slurm install //CentOS 7 system //192.168.159.141 node01 //192.168.159.142 node02 systemctl stop f ...

  4. centos install kafka and zookeeper

    1.安装zookeeper ZooKeeper is a distributed, open-source coordination service for distributed applicati ...

  5. centos install shutter (How to enable Nux Dextop repository on CentOS or RHEL)

    http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html Question: I would like to insta ...

  6. centos install redmine (项目管理工具)

    安装环境:Centos.mysql.Ruby.Apache.Redmineyum updateyum -y groupinstall "Development Tools"yum ...

  7. centos Install Docker

    安装必备软件 $ yum -y install iptables iptables-services net-tools vim wget $ wget -P ~ https://github.com ...

  8. install kubernetes cluster k8s集群安装

    一,安装docker-ce 17.031,下载rpm包 Wget -P /tmp https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/ ...

  9. docker学习笔记 --- centos install

    Docker简介: Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发 ...

随机推荐

  1. MySQL客户端工具推荐

    PhpMyAdmin 傻瓜级的 Web 页面管理器,无需到处安装,只需一台支持 PHP 运行环境的服务器 功能上一般只限数据表的增删改查 在一台安装了phpmyadmin的机器上是可以连其它服务器上的 ...

  2. mysql LAST_INSERT_ID 使用与注意事项

    在使用MySQL时,若表中含自增字段(auto_increment类型),则向表中insert一条记录后,可以调用last_insert_id()来获得最近insert的那行记录的自增字段值 $mdb ...

  3. PHP 二分查找(详细)

    <?php //        PHP 二分查找 function search($arr, $sea){ $low = 0;                // 确定数组的开始的下标 $len ...

  4. Myeclipse中创建Maven工程的时候没有 webapp-javaee6

    1. http://mvnrepository.com/artifact/org.codehaus.mojo.archetypes/webapp-javaee6/1.5 中有描述

  5. 下载安全程序需谨慎 黑客盯上XP用户

    中关村在线消息:微软在上周正式结束了对Windows XP的技术支持,而很多仍在使用Windows XP的用户会选择在网上自行下载第三方的安全工具.不过国外的安全机构Malwarebytes近日提醒, ...

  6. iOS Aspect Fit,Aspect Fill,Scale To Fill

    Scale:拉伸图片,图片变形. Aspect:图片长宽的保持比例,图片不变形. Aspect Fill(常用):图像充满容器.以长宽中小的参数为限制. Aspect Fit:图像在容器中完整显示.以 ...

  7. Ue4中的框选函数

    void AHUD::GetActorsInSelectionRectangle(TSubclassOf<class AActor> ClassFilter, const FVector2 ...

  8. UE4在C++中使用OnComponentBeginOverlap之类的时间

    首先说明一下,官方文档是错的,在4.10版本下,绑定函数在角色类的构造函数中不起作用.2016.2.12 这里角色类为例 首先在头文件中添加: UFUNCTION() void OnOverlapBe ...

  9. JavaScript 的同源策略

    同源策略限制了一个源(origin)中加载文本或脚本与来自其它源(origin)中资源的交互方式. 同源定义 如果两个页面拥有相同的协议(protocol),端口(如果指定),和主机,那么这两个页面就 ...

  10. Windows 8 系统安装

    系统城  http://www.xitongcheng.com/win8/ 1.  下载 win8: http://msdn.itellyou.cn/2.  准备 4G 以上 U 盘,下载 win8 ...