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. jsoup爬虫简书首页数据做个小Demo

    代码地址如下:http://www.demodashi.com/demo/11643.html 昨天LZ去面试,遇到一个大牛,被血虐一番,发现自己基础还是很薄弱,对java一些原理掌握的还是不够稳固, ...

  2. LINPACK測试

    1简单介绍 LINPACK是线性系统软件包(Linear system package) 的缩写. Linpack如今在国际上已经成为最流行的用于測试高性能计算机系统浮点性能的benchmark.通过 ...

  3. nginx只允许域名访问,禁止ip访问

    背景:为什么要禁止ip访问页面呢?这样做是为了避免其他人把未备案的域名解析到自己的服务器IP,而导致服务器被断网,我们可以通过禁止使用ip访问的方法,防止此类事情的发生. 解决方法:这里介绍修改配置文 ...

  4. Coolite简介

    Coolite Toolkit 简介 Coolite Toolkit 是一个支持ASP.NET AJAX的Web控件 Coolite Toolkit是基于跨浏览器的ExtJS 库开发而来的,并且简化了 ...

  5. vue 销毁组件

    销毁组件 // get~ 销毁组件 destroyElement() { this.$destroy(true); this.$el.parentNode.removeChild(this.$el); ...

  6. 用户输入URL后发生了什么,以及优化问题

    用户角度:1.打开浏览器2.输入URL3.按下回车4.浏览器呈现画面 当用户输入页面地址后,浏览器获得用户希望访问的地址,便向该站点服务器发起一系列的请求,这些请求不光包括对页面的请求,还包括对页面中 ...

  7. Python模块学习之fabric

    fabric是一个运维经常使用到的一个模块.但是我在python3环境下安装fabric就遇到了坑! 安装包名称是fabric3而不是fabric! pip install fabric3 利用fab ...

  8. 李洪强经典面试题49-Objective-C

    李洪强经典面试题49-Objective-C 面试笔试都是必考语法知识的.请认真复习和深入研究OC. Objective-C 方法和选择器有何不同?(Difference between method ...

  9. java - day12 - ShapeTest

    抽象类的定义及使用 抽象类不能实例化,但抽象类名的数组类型可以,见案例 package com.example; public class ShapeTest { public static void ...

  10. 使用pycharm手动搭建python语言django开发环境(四) django中buffer类型与str类型的联合使用

    在django中,如果用到buffer类型时,buffer的编码格式是utf-8类型.使用str()进行转为字符串类型会异常. 异常会有如下提示:'ascii' codec can't decode ...