首页 > 系统相关 >centos7安装zookeeper-3.7.2版本

centos7安装zookeeper-3.7.2版本

时间:2023-11-21 10:56:46浏览次数:37  
标签:bin .. zookeeper centos7 3.7 apache data

1、文件下载

本文档演示安装zookeeper-3.7.2版本。
进入官网下载:https://downloads.apache.org/zookeeper/zookeeper-3.7.2/
使用wget命令下载:

su root
mkdir /data/zookeeper
cd /data/zookeeper
wget https://downloads.apache.org/zookeeper/zookeeper-3.7.2/apache-zookeeper-3.7.2-bin.tar.gz

(如果没有安装wget,先安装yum install -y wget

直接使用浏览器访问下载地址:https://downloads.apache.org/zookeeper/zookeeper-3.7.2/apache-zookeeper-3.7.2-bin.tar.gz

2、环境准备

zookeeper是java语言编写的,需提前安装配置JDK环境,此版本zookeeper使用JDK8环境即可。

可参考:https://blog.csdn.net/xiao_yu_gan/article/details/124015831

3、安装配置
将下载好的zookeeper压缩包上传到服务器指定目录,这里以 /data/zookeeper 为例。

①解压压缩包

tar -zxvf apache-zookeeper-3.7.2-bin.tar.gz

②新建存放节点、日志的文件夹

cd /data/zookeeper/apache-zookeeper-3.7.2-bin
mkdir data
mkdir logs

③编辑配置文件

cd /data/zookeeper/apache-zookeeper-3.7.2-bin/conf

复制zoo_sample.cfg文件,命名为zoo.cfg

cp  zoo_sample.cfg  zoo.cfg

使用vi zoo.cfg命令编辑此配置文件,按照下面指示修改:

存放数据节点的目录,根据自己实际情况配置

dataDir=/data/zookeeper/apache-zookeeper-3.7.2-bin/data

存放日志信息的目录,根据自己实际情况配置

dataLogDir=/data/zookeeper/apache-zookeeper-3.7.2-bin/logs

4、启动验证
①启动服务端

cd /data/zookeeper/apache-zookeeper-3.7.2-bin/bin
./zkServer.sh start

控制台出现下面信息,则启动成功:

ZooKeeper JMX enabled by default
Using config: /data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

查看服务端状态:

[root@localhost bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone

②启动客户端

cd /data/zookeeper/apache-zookeeper-3.7.2-bin/bin
./zkCli.sh

控制台信息:

[root@localhost bin]# ./zkCli.sh
Connecting to localhost:2181
2022-04-25 16:31:54,777 [myid:] - INFO  [main:Environment@98] - Client environment:zookeeper.version=3.7.2--6401e4ad2087061bc6b9f80dec2d69f2e3c8660a, built on 04/08/2021 16:35 GMT
2022-04-25 16:31:54,785 [myid:] - INFO  [main:Environment@98] - Client environment:host.name=localhost
2022-04-25 16:31:54,785 [myid:] - INFO  [main:Environment@98] - Client environment:java.version=1.8.0_161
2022-04-25 16:31:54,786 [myid:] - INFO  [main:Environment@98] - Client environment:java.vendor=Oracle Corporation
2022-04-25 16:31:54,786 [myid:] - INFO  [main:Environment@98] - Client environment:java.home=/data/zookeeper/jdk1.8.0_161/jre
2022-04-25 16:31:54,786 [myid:] - INFO  [main:Environment@98] - Client environment:java.class.path=/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../zookeeper-server/target/classes:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../build/classes:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../zookeeper-server/target/lib/*.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../build/lib/*.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/zookeeper-prometheus-metrics-3.7.2.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/zookeeper-jute-3.7.2.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/zookeeper-3.7.2.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/snappy-java-1.1.7.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/slf4j-log4j12-1.7.25.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/slf4j-api-1.7.25.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/simpleclient_servlet-0.6.0.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/simpleclient_hotspot-0.6.0.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/simpleclient_common-0.6.0.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/simpleclient-0.6.0.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-transport-native-unix-common-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-transport-native-epoll-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-transport-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-resolver-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-handler-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-common-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-codec-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/netty-buffer-4.1.63.Final.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/metrics-core-3.2.5.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/log4j-1.2.17.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/json-simple-1.1.1.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jline-2.14.6.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-util-ajax-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-util-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-servlet-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-server-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-security-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-io-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jetty-http-9.4.39.v20210325.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/javax.servlet-api-3.1.0.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jackson-databind-2.10.5.1.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jackson-core-2.10.5.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/jackson-annotations-2.10.5.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/commons-cli-1.2.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../lib/audience-annotations-0.5.0.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../zookeeper-*.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../zookeeper-server/src/main/resources/lib/*.jar:/data/zookeeper/apache-zookeeper-3.7.2-bin/bin/../conf:.:/data/zookeeper/jdk1.8.0_161/lib/dt.jar:/data/zookeeper/jdk1.8.0_161/lib/tools.jar
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:java.io.tmpdir=/tmp
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:java.compiler=<NA>
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:os.name=Linux
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:os.arch=amd64
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:os.version=3.10.0-693.el7.x86_64
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:user.name=root
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:user.home=/root
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:user.dir=/data/zookeeper/apache-zookeeper-3.7.2-bin/bin
2022-04-25 16:31:54,787 [myid:] - INFO  [main:Environment@98] - Client environment:os.memory.free=23MB
2022-04-25 16:31:54,788 [myid:] - INFO  [main:Environment@98] - Client environment:os.memory.max=247MB
2022-04-25 16:31:54,789 [myid:] - INFO  [main:Environment@98] - Client environment:os.memory.total=29MB
2022-04-25 16:31:54,792 [myid:] - INFO  [main:ZooKeeper@1006] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@5aaa6d82
2022-04-25 16:31:54,798 [myid:] - INFO  [main:X509Util@77] - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
2022-04-25 16:31:54,805 [myid:] - INFO  [main:ClientCnxnSocket@239] - jute.maxbuffer value is 1048575 Bytes
2022-04-25 16:31:54,820 [myid:] - INFO  [main:ClientCnxn@1736] - zookeeper.request.timeout value is 0. feature enabled=false
2022-04-25 16:31:54,827 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1181] - Opening socket connection to server localhost/127.0.0.1:2181.
2022-04-25 16:31:54,827 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1183] - SASL config status: Will not attempt to authenticate using SASL (unknown error)
Welcome to ZooKeeper!
JLine support is enabled
2022-04-25 16:31:54,963 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1013] - Socket connection established, initiating session, client: /127.0.0.1:42174, server: localhost/127.0.0.1:2181
2022-04-25 16:31:55,005 [myid:localhost:2181] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1448] - Session establishment complete on server localhost/127.0.0.1:2181, session id = 0x100015a1b180002, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] 

标签:bin,..,zookeeper,centos7,3.7,apache,data
From: https://www.cnblogs.com/sili-future/p/17845742.html

相关文章

  • Centos7编译安装Python
    Centos7编译安装Python环境准备操作系统:Centos7版本:Python3.12下载wgethttps://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz编译安装#安装依赖yum-yinstallgcczlibzlib-devellibffilibffi-develreadline-developenssl-developenssl11openssl......
  • Centos7安装Mongodb社区版
    Centos7安装Mongodb社区版准备环境操作系统:Centos7安装包:https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-7.0.3.tgzwindows可视化工具:Studio3T(原robot3t)/DbeaverCE安装下载wget-Omongodb.tgzhttps://fastdl.mongodb.org/linux/mongodb-li......
  • CentOS7使用Docker-compose管理容器
    1.容器化的概念容器化是将应用程序代码和依赖项捆绑到一个单一的虚拟包中。容器化应用程序通常与其他应用程序并排放置,并通过计算机、服务器或云上的共享操作系统运行。2.容器化使用的场景1.简化不同环境配置差异虚拟机的最大好处是能在你的硬件设施上运行各种配置不一样的平......
  • centos7上安装tkinter
    报错:YoumustinstalltkinteronLinuxtouseMouseInfo.Runthefollowing:sudoapt-getinstallpython3-dev1#yuminstall-ytktk-develtcltcl-devel2重新编译Python$./configure--with-tcltk-includes='-I/usr/local/include'--with-tcltk-l......
  • docker于centos7下的安装配置
    docker于centos7下的安装配置导航目录docker于centos7下的安装配置导航一、安装前的环境配置检查自己版本,必须是centos7以及以上版本cat/etc/redhat-release卸载旧版本(如果之前没有安装过,这步可以忽略)yum安装gcc相关安装需要的软件包设置镜像源更新yum软件包索引二、安装docke......
  • Centos7 使用yum从第三方仓库安装Python3.8
    环境:CentOSLinuxrelease7.9.2009起因:Centos7自带Python2.7.5版本。而默认的YUM安装的python3是3.6版本,遂升级到3.8版本。installPython3.8yuminstall-ycentos-release-scl#仓库注册yuminstall-yrh-python38which#安装python3.8#创建软连接ln-s/opt......
  • Centos7 安装MySQL详细步骤
    1.1MySQL安装1.1.1下载wget命令yum-yinstallwget1.1.2在线下载mysql安装包wgethttps://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm1.1.3安装MySQLrpm-ivhmysql57-community-release-el7-8.noarch.rpm1.1.4安装mysql服务首先进入cd/et......
  • Centos7安装Redis(超详细)
    ​Redis是一个开源的使用ANSIC语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。从2013年5月开始,Redis的开发由Pivotal赞助。​下载地址:https://github.com/microsoftarchive/redis/re......
  • 2023最新!docker于centos7下的安装配置
    2023最新!docker于centos7下的安装配置导航目录2023最新!docker于centos7下的安装配置导航一、安装前的环境配置检查自己版本,必须是centos7以及以上版本cat/etc/redhat-release卸载旧版本(如果之前没有安装过,这步可以忽略)yum安装gcc相关安装需要的软件包设置镜像源更新yum软件包......
  • Windos操作系统下的Zookeeper安装图文教程
    凯哥已经准备好最新版本3.9.1且已经配置好了。既获取到配置好的。获取到凯哥准备的安装后,只需要修改一下配置。将解压包解压后,找到conf文件,里面有个zoo.cfg配置文件。如下图:下载后conf文件夹内容打开zoo.cfg配置文件后,找到13、14这两行。将dataDir和dataLogDir的路径修改成自......