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. 【Python3 爬虫】09_正则表达式(re.math()、re.search()、re.sub()、全局匹配函数)

    re.math()函数 从源字符串的起始位置匹配一个模式 语法:re.match(pattern, string, flag) 第一个参数代表对应的正则表达式,第二个参数代表对应的源字符,第三个参数是 ...

  2. Hibernate单向“一对多”关联

    1. 基于连接表的单向“一对多”关联,应该优先被采用其中指定many-to-many的unique="true",为单向“一对多”,不指定就是单向“多对多” <class n ...

  3. redis 使用内存超过maxmemory

    redis使用量超过了maxmemory,这时无法增加最大内存,redis 实例没有可用内存,导致命令都会执行失败 (error) OOM command not allowed when used ...

  4. docker run

    1.登录Docker Hub 账户 2.输入命令:构建一个web应用. docker run -d -P training/webapp python app.py 参数说明: -d:让容器在后台运行 ...

  5. class文件简介及加载

    Java编译器编译好Java文件之后,产生.class 文件在磁盘中.这种class文件是二进制文件,内容是只有JVM虚拟机能够识别的机器码.JVM虚拟机读取字节码文件,取出二进制数据,加载到内存中, ...

  6. redhat5.8系统学习

    # redhat5.8系统学习 ### 简介-----------------------------redhat操作系统是红帽公司的收费版操作系统 ### 查看系统版本号-------------- ...

  7. iOS开发中邮箱,电话号码,身份证,密码,昵称正则表达式验证

    //邮箱 + (BOOL) validateEmail:(NSString *)email {     NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@ ...

  8. Java并发编程(七)线程封闭

    当访问共享的可变数据时,通常需要使用同步.一种避免使用同步的方式就是不共享数据. 如果仅在单线程内访问数据,就不需要同步.这种技术被称为线程封闭(Thread Confinement),它是实现线程安 ...

  9. ubuntu如何使用minicom

    minicom是linux下串口通信的软件,它的使用完全依靠键盘的操作,虽然没有“超级终端”那么易用,但是使用习惯之后读者将会体会到它的高效与便利,下面将讲解minicom的安装和配置. 一.安装mi ...

  10. 简单介绍一下vue2.0

    Vue Vue是用于构建用户界面的渐进框架.作者尤雨熙特别强调它与其他的框架不同,Vue是渐进式的框架,可以逐步采用,不必一下就通过框架去重构项目. 另外Vue的核心库只专注于视图层,这样就更容易与其 ...