zoukankan      html  css  js  c++  java
  • Linux 下ZooKeeper安装

    下载

    到官网去下载你想要的版本 官网下载地址

     上传解压

    把你刚才下载的文件,上传到Linux文件系统中。然后解压:

    [root@localhost tmp]#tar -zxvf zookeeper-3.4.14.tar.gz

    将解压后的文件复制到/usr/local目录下,并重命名为zookeeper

    [root@localhost tmp]# cp zookeeper-3.4.14 /usr/local/zookeeper -r  //复制所有文件到zookeeper 文件夹下
    [root@localhost tmp]# cd /usr/local/zookeeper                       //切换到/usr/local/zookeeper目录下

    配置

    切换到zookeeper目录下的conf目录下,重新复制一份zoo_sample.cfg文件并命名为zoo.cfg

    [root@localhost zookeeper]# cd conf  //切换到目录下
    [root@localhost conf]# ll            //显示目录下的信息
    总用量 12
    -rw-r--r--. 1 root root  535 5月   8 18:17 configuration.xsl
    -rw-r--r--. 1 root root 2161 5月   8 18:17 log4j.properties
    -rw-r--r--. 1 root root  922 5月   8 18:17 zoo_sample.cfg
    [root@localhost conf]# cp zoo_sample.cfg zoo.cfg    //copy一份到当前目录下,并命名为zoo.cfg
    [root@localhost conf]# ll
    总用量 16
    -rw-r--r--. 1 root root  535 5月   8 18:17 configuration.xsl
    -rw-r--r--. 1 root root 2161 5月   8 18:17 log4j.properties
    -rw-r--r--. 1 root root  922 5月   8 18:29 zoo.cfg
    -rw-r--r--. 1 root root  922 5月   8 18:17 zoo_sample.cfg
    [root@localhost conf]#

    修改zoo.cfg文件如下:

    [root@localhost conf]# vi zoo.cfg

     前提是要创建/tmp/zookeeper/tmp/zookeeper/log目录,不然启动时会报错。

     最后一步配置环境变量:

    [root@localhost zookeeper]# vi /etc/profile            //编辑文件

    export ZOOKEEPER=/usr/local/zookeeper
    export PATH=$PATH:$ZOOKEEPER/bin
    [root@localhost zookeeper]# source /etc/profile    //使生效

    启动Zookeeper

    因为配置了环境变量,所以在任意目录下都可以运行以下启动命令启动Zookeeper。

    [root@localhost ~]# zkServer.sh start //启动
    
    [root@localhost ~]# zkServer.sh status  //查看运行状态

     启动客户端:

    [root@localhost ~]# zkCli.sh   //启动客户端

  • 相关阅读:
    什么样的人适合边打工边创业?
    手机市场分析
    《这个男人来自地球》台词
    关系网成网络盈利模式 LinkedIn网站探秘
    第二届手机应用大赛“金枝奖”评选
    乔布斯的平静让人不寒而栗
    发展移动互联网需理清商业模式
    好想看故乡夏夜的天空
    AdoHelper能否改写成单例模式?
    GMail邀请发放处
  • 原文地址:https://www.cnblogs.com/songbao/p/12922542.html
Copyright © 2011-2022 走看看