所有机器操作都一样!

注:zookeeper配置集群时 需把防火墙关掉 或者暴露配置文件里配置的端口,

并且在dataDir目录下要有myid文件

1 下载

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz

2 解压

tar -zxvf  zookeeper-3.4.10.tar.gz

3 修改配置文件

复制配置文件 zoo_sample.cfg 到zoo.cfg

cp zoo_sample.cfg zoo.cfg

vim zoo.cfg

# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/home/log/zookeeper
# the port at which the clients will connect
clientPort=
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=
#
# 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 dataDir
#autopurge.snapRetainCount=
# Purge task interval in hours
# Set to "" to disable auto purge feature
#autopurge.purgeInterv
server.=192.168.174.128::
server.=192.168.174.129::

4  在  dataDir=/home/log/zookeeper  目录下新建 myid 文件

写入一个字符 0

保存。

5 启动 ./zkServer.sh start

ZooKeeper JMX enabled by default
Using config: /home/service/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

6 查看启动状态 ./zkServer.sh status

  

ZooKeeper JMX enabled by default
Using config: /home/service/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: leader

zookeeper命令

./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}

start 启动

start-foreground 有启动过程的启动

stop 停止

restart 重启

status 查看启动状态

centos安装zookeeper,并集群配置的更多相关文章

  1. 在CentOS上安装ZooKeeper集群

    一共准备3个CentOS虚拟机 172.16.9.194 172.16.9.195 172.16.9.196 上传zookeeper-3.3.6.tar.gz到服务器并解压,3台服务器的目录结构如下 ...

  2. Centos安装Kafka集群

    kafka是LinkedIn开发并开源的一个分布式MQ系统,现在是Apache的一个孵化项目.在它的主页描述kafka为一个高吞吐量的分布式(能 将消息分散到不同的节点上)MQ.在这片博文中,作者简单 ...

  3. kafka集群与zookeeper集群 配置过程

    Kafka的集群配置一般有三种方法,即 (1)Single node – single broker集群: (2)Single node – multiple broker集群:    (3)Mult ...

  4. CentOS 7 ETCD集群配置大全

    目录 前言 环境准备 安装 静态集群 配置 node01 配置文件 node02 配置文件 node03 配置文件 启动测试 查看集群状态 生成TLS证书 etcd证书创建 安装cfssl工具集 生成 ...

  5. 在Linux上安装Zookeeper集群

    xl_echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.——这才是真正的堪称强大!! - ...

  6. 吴裕雄--天生自然HADOOP操作实验学习笔记:安装zookeeper集群

    实验目的 了解zookeeper的概念和原理 学会安装zookeeper集群并验证 掌握zookeeper命令使用 实验原理 1.Zookeeper介绍 ZooKeeper是一个分布式的,开放源码的分 ...

  7. zookeeper集群配置与启动——实战

    1,准备: A:三台linxu服务器: 10.112.29.177 10.112.29.172 10.112.29.174 命令 hostname 得到每台机器的 hostname vm-10-112 ...

  8. 利用VMware在虚拟机上安装Zookeeper集群

    http://blog.csdn.net/u010246789/article/details/52101026 利用VMware在虚拟机上安装Zookeeper集群 pasting

  9. java:zookeeper集群配置,dubbo

    1.zookeeper集群配置: 2.dubbo:(配置见视频)

随机推荐

  1. c#之break和continue的区别

    break:跳出循环,执行循环外的语句: continue:跳出此次循环,进入下一次循环:

  2. git 删除本地分支,删除远程分支

    本地分支 git branch -d 分支名 远程分支 git push origin --delete 分支名 查看所有分支 git branch -a

  3. MATLAB 代码规范

    标识符命名原则 标识符的名字应当直观,其长度应当符合"最小长度,最大信息量"原则 非矩阵变量 变量名应该以小写字母开头的大小写混合形式 譬如:shadowFadingTable,s ...

  4. 在linux上安装redis

    下载Redis安装包 wget  http://download.redis.io/releases/redis-3.2.9.tar.gz 解压Redis安装包 tar -zxvf redis-3.2 ...

  5. 手撕面试官系列(九):分布式限流面试专题 Nginx+zookeeper

    Nginx专题 (面试题+答案领取方式见侧边栏) 1.请解释一下什么是 Nginx?2.请列举 Nginx 的一些特性.3.请列举 Nginx 和 Apache 之间的不同点4.请解释 Nginx 如 ...

  6. Centos7 yum方式安装MySQL

    1.下载安装源 wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 2.yum方式安装 yu ...

  7. springboot+mybatis实现数据库的读写分离

    介绍 随着业务的发展,除了拆分业务模块外,数据库的读写分离也是常见的优化手段.方案使用了AbstractRoutingDataSource和mybatis plugin来动态的选择数据源选择这个方案的 ...

  8. 已拦截跨源请求:同源策略禁止读取位于XXX的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin'

    vue+springboot项目 前端发送请求微信 URL:http:/.........(企业微信的路径) 请求成功,数据发送过去可以接收到,处理完毕后发送返回值给我 我这边前端网络响应处可以看到返 ...

  9. Locust性能测试-参数化批量注册

    前言 实现场景:所有并发虚拟用户共享同一份测试数据,并且保证虚拟用户使用的数据不重复. 例如,模拟10用户并发注册账号,总共有100个手机号,要求注册账号不重复,注册完毕后结束测试 准备数据 虚拟用户 ...

  10. CF1109F Sasha and Algorithm of Silence's Sounds LCT、线段树

    传送门 构成一棵树可以分成两个限制:图不成环.图的点数-边数=1. 我们考虑枚举右端点\(r\)计算所有可能的左端点\(l\)的答案.我们先考虑第一个限制:图不成环.注意到当\(r\)确定的时候,满足 ...