dubbo系列-Linux下zookeeper的安装
来源:互联网 发布:美图特效软件 编辑:程序博客网 时间:2024/05/01 22:16
zookeeper作为dubbo服务的注册中心,zookeeper是一个分布式的服务框架,是树形的目录服务的数据存储,能做到集群管理数据,能更好的作为dubbo服务的注册中心;当提供者出现断电等异常情况停机时,zookeeper注册中心会自动删除提供者的信息,当提供者重启时,zookeeper能够自动恢复注册数据,以及订阅请求;今天小编就带领大家在Linux上安装单节点的zookeeper;
☸ 前期准备
IP 地址:192.168.255.132
软件:zookeeper-3.4.8.tar.gz
☸ 实施步骤
✎ 修改 /etc/hosts 文件,添加主机名和IP地址的映射
# zookeeper cluster servers
192.168.1.81 edu-zk-01
✎上传或者下载zookeeper的软件到某一个目录(本篇使用/root为路径):
本次使用版本为:zookeeper-3.4.8.tar.gz
✎ 解压 zookeeper 安装包, 并按节点号对 zookeeper 目录重命名:
$ tar -zxvf zookeeper-3.4.8.tar.gz
服务器 为:
$ mv zookeeper-3.4.8 node-01
✎ 在zookeeper的节点目录下创建以下目录:
$ cd /root/zookeeper-3.4.8
$ mkdir data
$ mkdir logs
✎ 将zookeeper/conf目录下的zoo_sample.cfg文件拷贝一份,并重命名为 zoo.cfg
$ cp zoo_sample.cfg zoo.cfg
✎ 修改 zoo.cfg 配置文件:
路径为:/root/zookeeper-3.4.8/conf/zoocfg
修改内容:
# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=/root/zookeeper-3.4.8/datadataLogDir=/root/zookeeper-3.4.8/logs# the port at which the clients will connectclientPort=2181# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## 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=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1server.1=edu-provider-01:2888:3888✎ 在dataDir=/root/zookeeper-3.4.8/data 目录下创建myid 文件
$vi /root/zookeeper-3.4.8/data/myid## 值为1
✎ 由于版本问题,centos需要将防火墙关闭:
#systemctl stop firewalld.service
✎ 启动并测试zookeeper服务,在/root/zookeeper-3.4.8/bin目录中执行
$ ./zkServer.sh start
输入jps命令查看当前进程:
如果出现1456 QuorumPeerMain 则说明 启动正常
到这里,在Linux环境中安装zookeeper服务的步骤就完成了,如果有需要大家可以根据上述的步骤做一下,但要注意路径的统一;
最后送大家一句话共勉:生命不息,奔跑不止
- dubbo系列-Linux下zookeeper的安装
- Linux系统下Zookeeper的安装、dubbo使用注意事项
- Zookeeper系列—Linux下的安装
- linux 下安装zookeeper及配置dubbo
- linux 安装dubbo+zookeeper
- linux 安装dubbo+zookeeper
- linux 安装dubbo+zookeeper
- 分布式linux下的dubbo+zookeeper+tomcat
- dubbo-zookeeper的安装
- (dubbo学习)linux 安装dubbo+zookeeper
- linux安装zookeeper与dubbo
- 【dubbo】-003 dubbo中 ZooKeeper的安装
- linux下zookeeper的安装
- Linux下zookeeper的安装
- linux上dubbo+zookeeper的安装与部署
- Linux下安装zookeeper
- Linux下安装Zookeeper
- linux下安装zookeeper
- 【bzoj 1606】 [Usaco2008 Dec]Hay For Sale 购买干草 01背包
- ISLR第五章重采样方法应用练习题
- React入门教程(一)——JSX学习篇
- 操作系统之PV操作
- 你可能不知道的ListView Recycler机制
- dubbo系列-Linux下zookeeper的安装
- 免费论文查重
- Java内存模型
- 关于网格部件选人实现勾选与自动同步选项功能构建
- SimpleDateFormat时间不正确的问题
- leetcode---Longest Substring Without Repeating Characters
- linux安装redis及redis扩展
- DDD领域驱动设计基本理论知识总结
- AFNetworking 3 批量上传图片的 3 种方法