在 CentOS7 上安装 Zookeeper服务
1、创建 /usr/local/services/zookeeper 文件夹:
mkdir -p /usr/local/services/zookeeper
2、进入到 /usr/local/services/zookeeper 目录中:
cd /usr/local/services/zookeeper
3、下载 zookeeper-3.4.9.tar.gz:
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz
4、解压缩 zookeeper-3.4.9.tar.gz:
tar -zxvf zookeeper-3.4.9.tar.gz
5、进入到 /usr/local/services/zookeeper/zookeeper-3.4.9/conf 目录中:
cd zookeeper-3.4.9/conf/
6、复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:
cp zoo_sample.cfg zoo.cfg
7、用 vim 打开 zoo.cfg 文件并修改其内容为如下:
# The number of milliseconds of each tick # zookeeper 定义的基准时间间隔,单位:毫秒
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=/tmp/zookeeper # 数据文件夹
dataDir=/usr/local/services/zookeeper/zookeeper-3.4./data # 日志文件夹
dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4./logs # the port at which the clients will connect
# 客户端访问 zookeeper 的端口号
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.purgeInterval=
8、保存并关闭 zoo.cfg 文件:
9、进入到 /usr/local/services/zookeeper/zookeeper-3.4.9/bin 目录中:
cd ../bin/
10、用 vim 打开 /etc/ 目录下的配置文件 profile:
vim /etc/profile
并在其尾部追加如下内容:
#idea - zookeeper-3.4. config start - --
export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4./
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
#idea - zookeeper-3.4. config end - --
11、使 /etc/ 目录下的 profile 文件即可生效:
source /etc/profile
12、启动 zookeeper 服务:
zkServer.sh start
如打印如下信息则表明启动成功:
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
13、查询 zookeeper 状态:
zkServer.sh status
14、关闭 zookeeper 服务:
zkServer.sh stop
如打印如下信息则表明成功关闭:
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
15、重启 zookeeper 服务:
zkServer.sh restart
如打印如下信息则表明重启成功:
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
实际操作如下:

集群配置:

在 CentOS7 上安装 Zookeeper服务的更多相关文章
- 如何在Centos7上安装zookeeper 多实例
一.如何在Centos7上安装zookeeper 多实例 cd /usr/local/src/ wget https://mirrors.tuna.tsinghua.edu.cn/apache/zoo ...
- centos7上安装zookeeper
centos7上安装zookeeper 1 准备工作 1.准备服务器,本次安装采用 centos7系统.内存2G.存储60G的虚拟机服务器一台: 2.服务器安装java环境: 参考文章<cent ...
- 在 CentOS7 上部署 zookeeper 服务
在 CentOS7 上部署 zookeeper 服务 1 用 SecureCRT 或 XShell 等 Linux 客户端工具连接至 CentOS7 服务器: 2 进入到 /usr/local/too ...
- CentOS7上安装FTP服务
---------------------------------------------------------------------------------------------------- ...
- 在CentOS7上安装和使用ZooKeeper最新版本(V3.4.12)
0.ZooKeeper文档 http://zookeeper.apache.org/doc/r3.4.11/zookeeperOver.html 1.准备 在CentOS7上安装zookeeper时, ...
- 在 CentOS7 上安装 zookeeper-3.4.9 服务
在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...
- Linux上安装Zookeeper以及一些注意事项
最近打算出一个系列,介绍Dubbo的使用. 分布式应用现在已经越来越广泛,Spring Could也是一个不错的一站式解决方案,不过据我了解国内目前貌似使用阿里Dubbo的公司比较多,一方面这个框架也 ...
- centos7下安装zookeeper&zookeeper集群的搭建
一.centos7下安装zookeeper 1.zookeeper 下载地址 https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/ 2.安装步骤 ...
- 在 CentOS7 上安装 MongoDB
在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...
随机推荐
- ubuntu如何安装或更换内核
内核是一个系统的灵魂,系统在启动的时候,就是基于相关的内核启动该系统的.我们怎么样更改ubuntu系统的内核并运行它呢? ubuntu18.04LTS 互联网安装内核. 安装内核的步骤非常简单,我们可 ...
- Houdini技术体系 基础管线(四) :Houdini驱动的UE4植被系统 下篇
背景 在上篇中,实现了使用Houdini在UE4里根据地形过程生成植被的最基本的原型.并且支持把植被在UE4里Bake成使用的HierarchicalInstancedStaticMeshCompon ...
- Cesium打包命令
package.json中 (1) npm run build Source/Cesium.js 仅是把Cesium源码中一千两百多个js文件做了一下引用,并不会进行打包 所以这个Cesium.js也 ...
- 定时 清理 elasticsearch 6.5.4 的 索引 文件
#!/bin/sh ip='127.0.0.1' port=' day=`date -d "2 days ago" +%Y%m%d` #day=`date -d "5 h ...
- PHP5.5+ APC 安装
因php 语言特性(短链接), 没法实现共享内存来提升性能. apc的出现给出了一个解决方案 .不过很可惜5.5+以后PHP官方已经废弃掉这个扩展. 幸好出现了 apcu扩展提供后续功能 api 也没 ...
- LeetCode - 768. Max Chunks To Make Sorted II
This question is the same as "Max Chunks to Make Sorted" except the integers of the given ...
- Chrome Google浏览器下载
https://support.google.com/chrome/answer/95346?co=GENIE.Platform%3DDesktop&hl=zh-Hans 下载和安装 G ...
- [Educational Round 3][Codeforces 609E. Minimum spanning tree for each edge]
这题本来是想放在educational round 3的题解里的,但觉得很有意思就单独拿出来写了 题目链接:609E - Minimum spanning tree for each edge 题目大 ...
- vue里的watch 和 computed 监听的不同
1.computed里是偏向于通过监听data里的值变化后,经过运算返回一个新的计算结果, 所以k不能与data里的k重名,并且必须有return, 能够缓存,依赖的值不变化不会进行重复计算: 而wa ...
- 特殊字符url编码以后再解码后出现错误(¬ , ¢, ¤, £)
Url编码的原内容是 “¬ify_url=xxxx” 经过url编码以后再解码回来 “¬”的部分就变成了“¬” 解决方案:把原文里面待url编码的&符号先替换成 ...