下载zookeeper

# 创建zookeeper文件夹
cd /usr/local/
mkdir zookeeper
cd zookeeper # 下载 解压
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/current/apache-zookeeper-3.6.2-bin.tar.gz tar -zxvf apache-zookeeper-3.6.2-bin.tar.gz

配置zookeeper

cd /usr/local/zookeeper/apache-zookeeper-3.6.2-bin/conf

# cp 一份zoo_sample.cfg
cp zoo_sample.cfg zoo.cfg # 修改以下配置
vim zoo.cfg dataDir=/usr/local/zookeeper/apache-zookeeper-3.6.2-bin/dataDir
dataLogDir=/usr/local/zookeeper/apache-zookeeper-3.6.2-bin/dataLogDir
quorumListenOnAllIPs=true

zoo.cfg

# 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=/usr/local/zookeeper/apache-zookeeper-3.6.2-bin/dataDir
dataLogDir=/usr/local/zookeeper/apache-zookeeper-3.6.2-bin/dataLogDir
# the port at which the clients will connect
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 ## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true
quorumListenOnAllIPs=true

添加到全局环境变量

vim /etc/profile

# 添加到最后zookeeper
export ZOOKEEPER_HOME=/usr/local/zookeeper/apache-zookeeper-3.6.2-bin
export PATH=$PATH:$ZOOKEEPER_HOME/bin # 刷新配置
source /etc/profile

启动命令

服务管理命令:zkServer.sh start|stop|restart|status
客户端连接:zkCli.sh -server ${ip}:${port}

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. NoSql1 在Linux(CentOS)上安装memcached及使用

    前言:       今天是初五,生活基本要从过年的节奏中回归到正常的生活了,所以想想也该想想与工作有关的事情了.我之前在工作中会经常使用memcached和redis,但是自己一直没有时间系统的好好看 ...

  3. 在Ubuntu|CentOS上安装Shutter截图工具及快捷键设置

    简介 Shutter前身叫GScrot,它是一款相当棒的截图软件. 通过Shutter,你可以截取包括选定区域.全屏幕.窗口.窗口内的控件甚至网页的图像.通过内置的强大插件机制,你可以在截图后,对图像 ...

  4. 在CentOS上安装rabbitmq-server

    ***在 CentOS 6.4上安装python*** 注意啊,自己手动安装python2.7.5,不要动系统上面其他的版本 1,先安装GCC,用如下命令yum install gcc gcc-c++ ...

  5. CentOS上安装软件错误提示:configure: error: no acceptable C compiler found in $PATH

    CentOS上安装软件错误提示:configure: error: no acceptable C compiler found in $PATH 因为是centos linux,默认可以采用yum方 ...

  6. 如何在centos上安装epel源

    一.EPEL是什么? EPEL (Extra Packages for Enterprise Linux,企业版Linux的额外软件包) 是Fedora小组维护的一个软件仓库项目,为RHEL/Cent ...

  7. 在Centos上安装RabbitMQ流程(转)

    在Centos上安装RabbitMQ流程------------------------ 1. 需求 由于项目中要用到消息队列,经过ActiveMQ与RabbitMQ的比较,最终选择了RabbbitM ...

  8. CentOS上安装Node.js

    CentOS上安装Node.js [日期:2014-07-21] 来源:Linux社区  作者:maskdfe [字体:大 中 小]     CentOS上安装Node.js(想在Linux上学习No ...

  9. Linux系统入门学习:在CentOS上安装phpMyAdmin

    问题:我正在CentOS上运行一个MySQL/MariaDB服务,并且我想要通过网络接口来用phpMyAdmin来管理数据库.在CentOS上安装phpMyAdmin的最佳方法是什么? phpMyAd ...

随机推荐

  1. 为LInux系统安装坚果云网盘

    首先 从www.jianguoyun.com/s/downloads/linux 中下载安装包(deb.rpm) deb 包安装及解决依赖方法 1. 使用 gdebi 安装,自动安装依赖 sudo g ...

  2. java课堂考试总结

    9月22日,进行了开学第一堂的java测试,来检验暑假的自学成果.下午的考试中,时间应该是比较充分的,但是我还是有许多功能模块没有完成,功能缺少,在进行测试的时候暴露出了许多漏洞. 总结一下,在暑假的 ...

  3. 【论文阅读】End to End Learning for Self-Driving Cars

    前言引用 [1] End to End Learning for Self-Driving Cars从这里开始 [1.1] 这个是相关的博客:2016:DRL前沿之:End to End Learni ...

  4. 手写系列-实现一个铂金段位的 React

    一.前言 本文基于 https://pomb.us/build-your-own-react/ 实现简单版 React. 本文学习思路来自 卡颂-b站-React源码,你在第几层. 模拟的版本为 Re ...

  5. height设置100%不起作用

    详细讲解了原因:http://www.webhek.com/post/css-100-percent-height.html

  6. 40.qt quick- 高仿微信实现局域网聊天V4版本(支持gif动图表情包、消息聊天、拖动缩放窗口)

    在上章37.qt quick- 高仿微信实现局域网聊天V3版本(添加登录界面.UDP校验登录.皮肤更换.3D旋转),我们已经实现了: 添加登录界面. UDP校验登录. 皮肤更换. 3D旋转(主界面和登 ...

  7. php使用curl模拟post请求

    废话不多说,直接上代码,做个笔记. $url="http://localhost/header_server.php"; $body = array("mobile&qu ...

  8. 安装geatpy库到指定的conda虚拟环境中

    在Anaconda Prompt中输入conda install geatpy,提示找不到这个库: 输入pip install geatpy,安装成功:但是安装在默认conda环境下(以下为pycha ...

  9. P6753 [BalticOI 2013 Day1] Ball Machine

    P6753 [BalticOI 2013 Day1] Ball Machine 题意 给你一个树,每次从根节点放一个求,如果其子节点有空这个球会向下滚,若有多个节点为空则找儿子中以子树内编号的最小值为 ...

  10. 单点登录详解(token简述)(七)

    前言 为什么整理单点登录? 主要的原因还是自己以前学习的时候曾经用过,但是时间太久,忘记了里面用到了哪些技术.及如何实现的,每次想到单点登录总是感觉即会又不会,这次整理session时,又涉及到了单点 ...