
zookeeper
kong-kong
记录流水账
展开
-
临时节点实现原理
DataTree/** key : sessionId value: 该sessionId创建的临时节点列表* This hashtable lists the paths of the ephemeral nodes of a session.*/private final Map<Long, HashSet<String>> ephemerals = new ConcurrentHashMap<Long, HashSet<String>>(原创 2021-09-02 22:10:06 · 469 阅读 · 0 评论 -
docker安装standalone的zookeeper3.4.13
下载镜像docker pull docker.io/zookeeper:3.4.13创建目录及文件mkdir -p /mydata/zookeeper/confmkdir -p /mydata/zookeeper/datamkdir -p /mydata/zookeeper/logcd /mydata/zookeeper/conftouch zoo.cfgvi zoo.cfgzoo.cfgclientPort=2181# 注意zoo.cfg(容器里)不要指定/mydata/zook原创 2021-06-19 01:46:14 · 489 阅读 · 0 评论 -
zookeeper 3.5.9 源码导入idea
clonegit clone -b release-3.5.9 https://github.com/apache/zookeeper.gitcompilemvn clean compile -DskipTestsprovidedzookeeper-server下面的pom的provided都注释掉,应该有7处<dependency> <groupId>jline</groupId> <artifactId>jl.原创 2021-03-20 13:59:05 · 339 阅读 · 0 评论 -
单机部署2个zookeeper报错问题
以前部署了1个zookeeper-3.4.14,由于curator版本问题,现在要用到3.5,下载apache-zookeeper-3.5.8,启动后报错了一开始把dataDir和clientPort改了比如这里报了8080端口被占用问题org.apache.zookeeper.server.admin.AdminServer$AdminServerException: Problem starting AdminServer on address 0.0.0.0, port 8080 and原创 2020-08-27 11:03:54 · 503 阅读 · 0 评论 -
TreeCache
http://curator.apache.org/curator-recipes/tree-cache.htmlTree CacheDescriptionA utility that attempts to keep all data from all children of a ZK path locally cached. This class will watch the ZK path, respond to update/create/delete events, pull down原创 2020-08-27 08:47:23 · 626 阅读 · 0 评论 -
PathCache
http://curator.apache.org/curator-recipes/path-cache.htmlDescriptionA Path Cache is used to watch a ZNode. Whenever a child is added, updated or removed, the Path Cache will change its state to contain the current set of children, the children's data a原创 2020-08-26 19:43:18 · 350 阅读 · 0 评论 -
NodeCache
http://curator.apache.org/curator-recipes/node-cache.htmlParticipating ClassesNodeCache NodeCacheListener ChildDataUsageCreating a NodeChildrenCachepublic NodeCache(CuratorFramework client, String path)Parameters:clie原创 2020-08-26 19:08:28 · 995 阅读 · 0 评论 -
zookeeper命令
# 创建节点create [-s] [-e] path data acl-s 创建有序节点-e 创建临时节点create /node1 node1data# 创建持久节点create -s /node localhost# 创建临时节点create -e /nodetmp localhost# 获取节点信息get path 比如 get /pat...原创 2020-01-15 11:00:33 · 413 阅读 · 0 评论 -
zookeeper单机安装
下载地址:wgethttps://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz#解压tar -xzvf zookeeper-3.4.14.tar.gzmv zookeeper-3.4.14 zookeepercd /usr/local...原创 2020-01-15 10:47:00 · 341 阅读 · 0 评论 -
zookeeper源码环境搭建
源码路径: https://github.com/apache/zookeeper clone到本地git clone https://github.com/apache/zookeeper.git cd zookeeper查看远程分支git branch -a查看本地分支git branch 切换分支 git checkou...原创 2018-12-22 09:13:17 · 441 阅读 · 0 评论