下载http://www.apache.org/dyn/closer.cgi/zookeeper(我下的是zookeeper-3.4.14)

1、创建 /usr/local/services/zookeeper 文件夹:

    mkdir -p /usr/local/services/zookeeper
 
2、进入到 /usr/local/services/zookeeper 目录中:
    cd /usr/local/services/zookeeper
 
3、下载 zookeeper-3.4.9.tar.gz:
    wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz
 
4、解压缩 zookeeper-3.4.9.tar.gz:
    tar -zxvf zookeeper-3.4.9.tar.gz
 
5、进入到 /usr/local/services/zookeeper/zookeeper-3.4.9/conf 目录中:
    cd zookeeper-3.4.9/conf/
 
6、复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:
    cp zoo_sample.cfg zoo.cfg
 
7、用 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.9/data
 
    # 日志文件夹
    dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4.9/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
 
8、保存并关闭 zoo.cfg 文件:
     
9、进入到 /usr/local/services/zookeeper/zookeeper-3.4.9/bin 目录中:
    cd ../bin/
 
10、用 vim 打开 /etc/ 目录下的配置文件 profile:
    vim /etc/profile
    并在其尾部追加如下内容:
 
    # idea - zookeeper-3.4.9 config start - 2016-09-08
 
    export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4.9/
    export PATH=$ZOOKEEPER_HOME/bin:$PATH
    export PATH
 
    # idea - zookeeper-3.4.9 config start - 2016-09-08
 
11、使 /etc/ 目录下的 profile 文件即可生效:
    source /etc/profile
 
12、启动 zookeeper 服务:
    zkServer.sh start
    如打印如下信息则表明启动成功:
    ZooKeeper JMX enabled by default
    Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
    Starting zookeeper ... STARTED
 
13、查询 zookeeper 状态:
    zkServer.sh status
 
14、关闭 zookeeper 服务:
    zkServer.sh stop
    如打印如下信息则表明成功关闭:
    ZooKeeper JMX enabled by default
    Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
    Stopping zookeeper ... STOPPED
 
15、重启 zookeeper 服务:
    zkServer.sh restart
    如打印如下信息则表明重启成功:
    ZooKeeper JMX enabled by default
    Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
    ZooKeeper JMX enabled by default
    Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
    Stopping zookeeper ... STOPPED
    ZooKeeper JMX enabled by default
    Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
    Starting zookeeper ... STARTED

ZooKeeper CentOS7上安装的更多相关文章

  1. 在CentOS7上安装和使用ZooKeeper最新版本(V3.4.12)

    0.ZooKeeper文档 http://zookeeper.apache.org/doc/r3.4.11/zookeeperOver.html 1.准备 在CentOS7上安装zookeeper时, ...

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

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

  3. centos7上安装zookeeper

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

  4. 在 CentOS7 上安装 zookeeper-3.4.9 服务

    在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...

  5. 在CentOS7上安装JDK1.8

    在CentOS7上安装JDK1.8 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目录 to ...

  6. 在centos7上安装Jenkins

    在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...

  7. 在 CentOS7 上安装 MongoDB

    在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...

  8. 在 CentOS7 上安装 MySQL5.7

    在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...

  9. 在 CentOS7 上安装 Tomcat9

    在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...

随机推荐

  1. Oracle学习(四)SQL高级--表优化相关(序列、视图等)

    INDEX(索引) 可以在表中创建索引,以便更加快速高效地查询数据. 用户无法看到索引,它们只能被用来加速搜索/查询. PS:更新一个包含索引的表需要比更新一个没有索引的表花费更多的时间,这是由于索引 ...

  2. Mysql探索之Explain执行计划详解

    前言 如何写出效率高的SQL语句,提到这必然离不开Explain执行计划的分析,至于什么是执行计划,如何写出高效率的SQL,本篇文章将会一一介绍. 执行计划 执行计划是数据库根据 SQL 语句和相关表 ...

  3. RocketMQ 笔记

    Queue Topic和Queue是1对多的关系,一个Topic下可以包含多个Queue,主要用于负载均衡.发送消息时,用户只指定Topic,Producer会根据Topic的路由信息选择具体发到哪个 ...

  4. 读完这篇,让你真正理解Redis持久化

    什么叫持久化? 用一句话可以将持久化概括为:将数据(如内存中的对象)保存到可永久保存的存储设备中. 持久化的主要应用是将内存中的对象存储在数据库中,或者存储在磁盘文件中. XML 数据文件中等等. 也 ...

  5. is_mobile()判断手机移动设备

    is_mobile()判断手机移动设备.md is_mobile()判断手机移动设备 制作响应式主题时会根据不同的设备推送不同的内容,是基于移动设备网络带宽压力,避免全局接收pc端内容. functi ...

  6. WPF DataGrid 复合表头 (实现表头合并,自定义表头)

    功能说明: 将 DataGrid嵌套在本控件内,使用Label自定义表头,如果需要上下左右滚动 需要在控件外围添加  ScrollViewer 并且设置  ScrollVisibility 为Auto ...

  7. (转载)Tomcat 7集群浅析

    本文转载自:http://blog.csdn.net/wangyangzhizhou. 如有侵权,请联系处理!   简介 每个节点都要维护一份集群节点信息列表,集群组通知的默认实现是在使用 UDP 数 ...

  8. Python练习题 013:求解a+aa+aaa……

    [Python练习题 013] 求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字.例如2+22+222+2222+22222(此时共有5个数相加),几个数相加由键盘输入. 这题倒也 ...

  9. Book of Shaders 03 - 学习随机与噪声生成算法

    0x00 随机 我们不能预测天空中乌云的样子,因为它的纹理总是具有不可预测性.这种不可预测性叫做随机 (random). 在计算机图形学中,我们通常使用随机来模拟自然界中的噪声.如何获得一个随机值呢, ...

  10. DoModal 函数的用法

    转载:https://blog.csdn.net/mpp_king/article/details/79707728                        https://www.cnblog ...