参考: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. $.ajaxSetup()与$.ajax()区别

    ajaxSetup()其使用方法与ajax()并无区别,只是在其之后的ajax()不用再重复添加相同参数,节省了代码量. 附:API中关于jQuery.ajaxSetup([options])的描述和 ...

  2. Subversion和TortoiseSVN,VisualSVN图文教程

    转自:http://www.veryhuo.com/a/view/156054.html 本文为大家介绍一下SVN使用教程,在开始之前,您有必要了解一下为什么要使用SVN?因为程序员在编写程序的过程中 ...

  3. SQL SERVER-Job中Operators搬迁脚本

    选中operators按F7,然后选中对象,生成脚本 USE [msdb] GO /****** Object: Operator [DB_ITDESK] Script Date: 5/30/2019 ...

  4. Android笔记(六) Android中的组件

    一个软件可以吸引到用户,除了优秀的功能可以解决用户的问题之外,良好的用户界面也并不可少.一个软件的功能不管多么优秀,但是没有提供友好的界面来让用户操作,将很难吸引到最终用户. Android提供了大量 ...

  5. Cknife流量分析

    本文首发:https://<img src=1 onerror=\u006coc\u0061tion='j\x61v\x61script:\x61lert\x281\x29'>testde ...

  6. charles 手机抓包设置

    本文参考:charles 抓包手机 charles经常会进行手机上的网页抓包,比如去copy别人网站图片或脚本的时候o(∩_∩)o : 手机抓包的原理,和PC类似,手机依靠charles与服务端进行对 ...

  7. visual studio调试exe程序

    标题:How to debug and profile any EXE with Visual Studio 文章:https://devblogs.microsoft.com/visualstudi ...

  8. CMake---基础练习2

    # t2/ CMakeLists.txt cmake_minimum_required(VERSION 2.8) #1 #PROJECT (HELLO) #SET(SRC_LIST main.c) # ...

  9. LearnOpenGL学习笔记(二)纹理

    开始学习OpenGL,参考的是著名的LearnOpenGL这个网站,在这里做一些总结性的记录,只是方便自己日后查找或者记录自己的一些拓展思考,关于OpenGL的具体内容请移步: https://lea ...

  10. Aure Event Hubs小白完全入门指南

    refer to https://www.cnblogs.com/mysunnytime/p/11634815.html?from=groupmessage&isappinstalled=0 ...