在CentOS7中安装zookeeper
参考: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的更多相关文章
- centos7上安装zookeeper
		
centos7上安装zookeeper 1 准备工作 1.准备服务器,本次安装采用 centos7系统.内存2G.存储60G的虚拟机服务器一台: 2.服务器安装java环境: 参考文章<cent ...
 - centos7下安装zookeeper&zookeeper集群的搭建
		
一.centos7下安装zookeeper 1.zookeeper 下载地址 https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/ 2.安装步骤 ...
 - 在centos7中安装Robot Framework
		
安装前景介绍: 最初,我们是在Windows环境下搭建Robot Framework来对我们的服务进行接口测试的(想知道如何在Windows下安装Robot Framework,可以参考我同事的博客h ...
 - centos7中安装、配置、验证、卸载redis
		
本文介绍在centos7中安装.配置.验证.卸载redis等操作,以及在使用redis中的一些注意事项. 一 安装redis 1 创建redis的安装目录 利用以下命令,切换到/usr/local路径 ...
 - centos7中安装mongodb3.6
		
centos7中安装mongodb3.6 首先更新系统 yum -y update 1.安装Mongodb 编辑Mongodb安装源 vim /etc/yum.repos.d/mongodb-org- ...
 - 如何在Centos7上安装zookeeper 多实例
		
一.如何在Centos7上安装zookeeper 多实例 cd /usr/local/src/ wget https://mirrors.tuna.tsinghua.edu.cn/apache/zoo ...
 - 在Centos7中安装elasticsearch5.5
		
在Centos7中安装elasticsearch5.5 第一步:必须要有jre支持 elasticsearch是用Java实现的,跑elasticsearch必须要有jre支持,所以必须先安装jre ...
 - centos7中安装mysql
		
centos7中安装mysql网上已经很多资源了,我就不在赘述了.我这里只是记录下我安装的时候出现的一些问题. 原文:https://www.cnblogs.com/bigbrotherer/p/72 ...
 - CentOS7中安装MySQL(简便)及 网站的搭建
		
一.首先,我们需要配置CentOS7中网络环境的搭建,物理机IP为192.168.100.39,虚拟机IP为192.168.100.139,网络模式设置为桥接模式 ,再进入系统挂载光盘.输入命令 ...
 
随机推荐
- 【转载】C#通过StartWith和EndWith方法判断字符串是否以特定字符开始或者结束
			
C#开发过程中针对字符串String类型的操作是常见操作,有时候业务需要判断某个字符串是否以特定字符开头或者特定字符结束,此时就可使用StartsWith方法来判断目标字符串是否以特定字符串开头,通过 ...
 - js入门之内置对象Date
			
一. Date对象 Math和Date对象的区别 Math对象和Date对象的区别 Math不是一个构造函数,里面提供的是静态成员 Date是一个构造函数 首先要通过new Date() 来创建日期实 ...
 - UI5-技术篇-Hybrid App-1-Barcode扫描
			
参考资料: https://www.w3cschool.cn/cordova/cordova_overview.html https://blogs.sap.com/2017/01/03/sapui5 ...
 - Linux误删python导致yum不可用,删除重装方法。
			
Linux 系统为 CentOS Linux release 7.4.1708 手贱.手贱.手贱 删了python 导致yum不可用.百度一大圈,重装yum和python后,老是报各种各样的错.历经磨 ...
 - djangoform表单使用验证码
			
8.1.安装captcha 直接安装:pip install django-simple-captcha Django自动帮我们安装了相关的依赖库six.olefile和Pillow,其中的Pillo ...
 - 中文论文-LaTex模板
			
\documentclass[10pt,UTF8]{article} \usepackage{ctex} \usepackage{amssymb,amsmath,multicol,titlesec} ...
 - Zabbix监控平台-----深入理解zabbix
			
一,Zabbix Web操作深入 (1)创建一个模版,所有的功能几乎都是在模版中定义的 点进新创建的模版查看,模版里几乎可以设定我们需要的所有功能 (2)在模版里创建应用集,应用集的作用就是将众多的监 ...
 - Android中sp和px之间关系探究
			
记得当时在刚接触Android时都在说不要用px,要用sp,所以在实际工作当中当然就按照这个规则,所以都要将px换算成sp,而我在实际工作中的换算规则是dp=px * 1.5,而且用这种规则到现在基本 ...
 - 【邻接矩阵+基础BFS】PAT-L3-008. 喊山
			
L3-008. 喊山 一个山头呼喊的声音可以被临近的山头同时听到.题目假设每个山头最多有两个能听到它的临近山头.给定任意一个发出原始信号的山头,本题请你找出这个信号最远能传达到的地方.[何为最远?大致 ...
 - uWSGI ,WSGI和uwsgi的区别
			
1.1.为方便理解,uWSGI ,WSGI和uwsgi在网站项目流程图中的功能如下: 1.2.网站项目结构图 2.uWSGI ,WSGI和uwsgi的区别 2.1 WSGI: WSGI,全称 Web ...