Centos7环境下安装ZooKeeper单例模式

Centos7环境下安装ZooKeeper单例模式,第1张

Centos7环境下安装ZooKeeper单例模式

文章目录

Centos7环境下安装ZooKeeper单例模式

软件环境

查找ZooKeeper最新版本 准备软件部署单例模式

使用默认配置启动ZooKeeper查看ZooKeeper状态使用ZkCli进行访问 网络配置

防火墙开放2181端口 可视化工具

ZooInspector

Centos7环境下安装ZooKeeper单例模式 软件环境

*** 作系统: CentOS Linux release 7.9.2009

ZooKeeper: ZooKeeper v3.7.0

  编写博客的时间为2022年1月,此时ZooKeeper的最新的发布版本为3.7.0。

查找ZooKeeper最新版本

  打开ZooKeeper发布页(https://zookeeper.apache.org/releases.html),找到最近的正式版。

releases.html

准备软件

基于wget下载

wget --no-check-certificate https://dlcdn.apache.org/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz

  由于没使用国内镜像链接进行下载,所以下载速度比较慢,可以采用其他方法自行下载。

解压tar.gz包

tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz
部署单例模式

  本案例以最简单的单例模式为例。

cd apache-zookeeper-3.7.0-bin
使用默认配置
cp ./conf/zoo_sample.cfg ./conf/zoo.cfg
启动ZooKeeper
bin/zkServer.sh start

输出如下:

ZooKeeper JMX enabled by default
Using config: /root/desktop/apache-zookeeper-3.7.0-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

查看ZooKeeper状态
bin/zkServer.sh status

输出如下:

ZooKeeper JMX enabled by default
Using config: /root/desktop/apache-zookeeper-3.7.0-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone
使用ZkCli进行访问
bin/zkCli.sh -server 127.0.0.1:2181
网络配置 防火墙开放2181端口
firewall-cmd --zone=public --add-port=2181/tcp --permanent
firewall-cmd --reload
可视化工具 ZooInspector

下载链接

https://issues.apache.org/jira/secure/attachment/12436620/ZooInspector.zip

启动软件

java -jar zookeeper-dev-ZooInspector.jar

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5704833.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存