参考:https://www.linuxidc.com/Linux/2016-09/135052.htm

1.zookeeper运行需要jdk环境,先确保有配置jdk,可以参考此处

2.下载解压zookeeper

  先创建下载目录

 mkdir -p /usr/local/services/zookeeper

  进入zookeeper目录

cd /usr/local/services/zookeeper

  下载稳定的zookeeper版本,可参考zookeeper官方下载地址,选择稳定版本,此处下载的是3.4.10版本

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

  解压文件

 tar -zxvf zookeeper-3.4.10.tar.gz

3.修改zookeeper配置文件

  进入到 /usr/local/services/zookeeper/zookeeper-3.4.10/conf 目录中,复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:

 cp zoo_sample.cfg zoo.cfg

  用 vim 打开 zoo.cfg 文件并修改其内容为如下:

# The number of milliseconds of each tick

    # zookeeper 定义的基准时间间隔,单位:毫秒
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.
# do not use /tmp for storage, /tmp here is just
# example sakes.
# dataDir=/tmp/zookeeper # 数据文件夹
dataDir=/usr/local/services/zookeeper/zookeeper-3.4.10/data # 日志文件夹
dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4.10/logs # the port at which the clients will connect
# 客户端访问 zookeeper 的端口号
clientPort=2181 # the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# 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=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

4.配置zookeeper环境变量

  用 vim 打开 /etc/ 目录下的配置文件 profile:

vim /etc/profile

  在其底部空白处追加如下内容

    #--- update for zookeeper---start
export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4.10/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
#---update for zookeeper---end

  使修改文件生效

source /etc/profile

5.操作zookeeper

  启动

zkServer.sh start

  查看运行状态

zkServer.sh status

  停止

 zkServer.sh stop

  重启

 zkServer.sh restart

在CentOS7中安装zookeeper的更多相关文章

  1. centos7上安装zookeeper

    centos7上安装zookeeper 1 准备工作 1.准备服务器,本次安装采用 centos7系统.内存2G.存储60G的虚拟机服务器一台: 2.服务器安装java环境: 参考文章<cent ...

  2. centos7下安装zookeeper&zookeeper集群的搭建

    一.centos7下安装zookeeper 1.zookeeper 下载地址 https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/ 2.安装步骤 ...

  3. 在centos7中安装Robot Framework

    安装前景介绍: 最初,我们是在Windows环境下搭建Robot Framework来对我们的服务进行接口测试的(想知道如何在Windows下安装Robot Framework,可以参考我同事的博客h ...

  4. centos7中安装、配置、验证、卸载redis

    本文介绍在centos7中安装.配置.验证.卸载redis等操作,以及在使用redis中的一些注意事项. 一 安装redis 1 创建redis的安装目录 利用以下命令,切换到/usr/local路径 ...

  5. centos7中安装mongodb3.6

    centos7中安装mongodb3.6 首先更新系统 yum -y update 1.安装Mongodb 编辑Mongodb安装源 vim /etc/yum.repos.d/mongodb-org- ...

  6. 如何在Centos7上安装zookeeper 多实例

    一.如何在Centos7上安装zookeeper 多实例 cd /usr/local/src/ wget https://mirrors.tuna.tsinghua.edu.cn/apache/zoo ...

  7. 在Centos7中安装elasticsearch5.5

    在Centos7中安装elasticsearch5.5 第一步:必须要有jre支持 elasticsearch是用Java实现的,跑elasticsearch必须要有jre支持,所以必须先安装jre ...

  8. centos7中安装mysql

    centos7中安装mysql网上已经很多资源了,我就不在赘述了.我这里只是记录下我安装的时候出现的一些问题. 原文:https://www.cnblogs.com/bigbrotherer/p/72 ...

  9. CentOS7中安装MySQL(简便)及 网站的搭建

    一.首先,我们需要配置CentOS7中网络环境的搭建,物理机IP为192.168.100.39,虚拟机IP为192.168.100.139,网络模式设置为桥接模式 ,再进入系统挂载光盘.输入命令   ...

随机推荐

  1. 【转载】网站配置Https证书系列(一):腾讯云申请免费的SSL证书的流程步骤(即https安全连接使用的证书)

    很多网站为了安全性考虑都会上https安全连接,此时就需要考虑使用SSL证书,其实在腾讯云这边提供有免费的SSL证书申请,登录腾讯云管理控制台后,进入SSL证书管理页面,里面有个申请免费证书.腾讯云申 ...

  2. linux文件比较

    Linux文件比较指令有两个,comm和diff,其中comm要求的是排序过得文件.Diff则没有这个要求,diff的输出结果主要是用来表明文件一经过怎样的修改可以得到文件二. Comm Comm的语 ...

  3. 理解下所谓的ssh隧道

    目录 一.含义 二.功能 三.Linux下应用的案例 参考文章 一.含义 client为了访问到server的服务,但是由于防火墙的阻拦,client没有办法通过正常访问来进行,这就用到了ssh隧道. ...

  4. Linux命令——ulimit

    参考:https://www.cnblogs.com/kongzhongqijing/p/5784293.html

  5. 读入 并查集 gcd/exgcd 高精度 快速幂

    ios_base::sync_with_stdio(); cin.tie(); ], nxt[MAXM << ], Head[MAXN], ed = ; inline void added ...

  6. Oracle之约束

    数据的完整性用于确保数据库数据遵从一定的商业的逻辑规则.在oracle中,数据完整性可以使用约束.触发器.应用程序(过程.函数)三种方法来实现,在这三种方法中,因为约束易于维护,并且具有最好的性能,所 ...

  7. git 和 svn比较

    SVN和Git 介绍,区别,优缺点,适用范围总结 原创 2016年01月29日 15:17:36 15774   介绍   SVN SVN是Subversion的简称,是一个开放源代码的版本控制系统, ...

  8. LOJ2823 三个朋友 ——查询字串的哈希值

    概念 查询字串的hash值 我们所说的哈希通常都是进制哈希,因为它具有一些很方便的性质,例如,具有和前缀和类似的性质. 假设一个字符串的前缀哈希值记为 $h[i]$,进制为 $base$,那么显然 $ ...

  9. CSP2019 D1T3 树上的数 (贪心+并查集)

    题解 因为博主退役了,所以题解咕掉了.先放个代码 CODE #include<bits/stdc++.h> using namespace std; const int MAXN = 20 ...

  10. docker:设置国内镜像仓储

    修改docker仓储镜像 vi /etc/docker/daemon.json 增加下面数据 { "registry-mirrors": ["https://xwx6wx ...