1.进入/opt

cd /opt

2.下载 zookeeper-3.4.10.tar.gz:

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
3.解压缩 zookeeper-3.4.10.tar.gz: 
tar -zxvf zookeeper-3.4.10.tar.gz
4.进入到 /opt/zookeeper-3.4.10/conf 目录中:
cd zookeeper-3.4./conf/

5.复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:

cp zoo_sample.cfg zoo.cfg
6.用 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=/opt/zookeeper-3.4./data # 日志文件夹
dataLogDir=/opt/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=

7.保存并关闭 zoo.cfg 文件:

     
8.进入到 /opt/zookeeper-3.4.10/bin 目录中:
 cd ../bin/
9.用 vim 打开 /etc/ 目录下的配置文件 profile:
    

vim /etc/profile
并在其尾部追加如下内容:
export ZOOKEEPER_HOME=/opt/zookeeper-3.4./
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
10.使 /etc/ 目录下的 profile 文件即可生效:
 source /etc/profile
11.启动 zookeeper 服务: 
zkServer.sh start
如打印如下信息则表明启动成功:
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.4./bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
12.查询 zookeeper 状态:
 zkServer.sh status
13.关闭 zookeeper 服务:  
[root@localhost bin]# zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.4./bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
14.重启 zookeeper 服务:
[root@localhost bin]# zkServer.sh restart
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.4./bin/../conf/zoo.cfg
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.4./bin/../conf/zoo.cfg
Stopping zookeeper ... no zookeeper to stop (could not find file /opt/zookeeper-3.4./data/zookeeper_server.pid)
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.4./bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

Centos7安装zookeeper的更多相关文章

  1. 1.centos7 安装zookeeper

    1.安装jdk 1)查找jdk包: yum search java|grep jdk 2)安装: yum install -y java-1.8.0-openjdk.x86_64 2. 安装ZooKe ...

  2. CentOS7 安装zookeeper

    本章介绍CentOS的初始配置与zookeeper的安装. www.apache.org/dist/上可以下载Hadoop整个生态环境的组件,我下的Zookeeper3.4.6版本 我一般都是在一个虚 ...

  3. linux centos7 安装zookeeper

    linux 系统下 zookeeper 安装教程 1.下载安装包 1)进入安装目录 cd /home/install/ 2)下载 wget http://mirror.bit.edu.cn/apach ...

  4. centos7 安装zookeeper 集群

    data 创建myid  设置1 zookeeper默认端口2181  同步端口 20881 和 30881 设置zoo.cfg文件

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

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

  6. centos7上安装zookeeper

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

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

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

  8. linux(CentOS7) 之 zookeeper 下载及安装

    下载 搜索apache ,进入apache官网(https://www.apache.org/)下载 选择downloads 下的distribution 点击archive site 找到zooke ...

  9. centos7 安装配置zookeeper

    https://blog.csdn.net/AaronLin6/article/details/78438877 https://www.cnblogs.com/sxdcgaq8080/p/74924 ...

随机推荐

  1. iOS开发-在Swift里使用AFNetworking方法

    在OC里使用惯了AFNetworking,比较喜欢这一个第三方库,在别的途径里得知可以在Swift里使用AFNetworking.但是那个时候我不知道具体的操作是怎样的,于是我只能去百度.GOOGLE ...

  2. Spark on Yarn 集群运行要点

    实验版本:spark-1.6.0-bin-hadoop2.6 本次实验主要是想在已有的Hadoop集群上使用Spark,无需过多配置 1.下载&解压到一台使用spark的机器上即可 2.修改配 ...

  3. 分享我们必须知道的高速GTX技术

    eSATA接口只有几根线为什么那么快?连上网线显示的1Gbps是不是很令人兴奋!没错他们都用了高速GTX技术,GTX全称为Gigabit Transceiver,是为了满足现代数字处理技术和计算技术庞 ...

  4. Angularjs学习笔记7_directive1

    1.基础知识 directive()接受两个参数 · name:字符串,指令的名字 · factory_function:函数,指令的行为 应用启动时,以name作为该应用的标识注册factory_f ...

  5. APACHE KYLIN™ 概览

    APACHE KYLIN™ 概览 Apache Kylin™是一个开源的分布式分析引擎,提供Hadoop之上的SQL查询接口及多维分析(OLAP)能力以支持超大规模数据,最初由eBay Inc. 开发 ...

  6. C++在线编译器

    主要有3个,且它们都支持C++11 http://gcc.godbolt.org/ http://coliru.stacked-crooked.com/ http://ideone.com/ 第一个网 ...

  7. docker的使用02

    自定义容器名称: docker run --name -i -t ubuntu /bin/bash docker ps -a 数据卷的使用 数据卷其实就是容器和宿主机目录之间的映射. 具体实现: su ...

  8. Call to a member function cellExists() on a non-object /phpexcel/Classes/PHPExcel/Calculation.php on line 3241

    PHP Fatal error: Call to a member function cellExists() on a non-object in /home/edata/eframework/we ...

  9. text-encoding正确使用姿势

    蓝牙打印,需要转字符串为gb2312到uint8array.果断使用了一把text-encoding,始终不对. https://github.com/inexorabletash/text-enco ...

  10. CentOS7安装mysql提示“No package mysql-server available

    在CentOS7上安装mysql时,出现了以下的提示: 原因是: CentOS7带有MariaDB而不是MySQL,MariaDB和MySQL一样也是开元的数据库,您可以使用yum -y instal ...