zookeeper_action
连接串
从节点列表本地缓存
主节点对未分配的任务,随机分配给从节点(不合理??)
从节点保存一个本地待执行任务列表
单独的线程对节点已分配任务进行循环
进程p为了获锁——>创建节点znode_/lock且其为临时节点:/lock 临时节点 避免该znode崩溃而锁无法释放

https://zookeeper.apache.org/doc/trunk/zookeeperOver.html
ZooKeeper is a distributed, open-source coordination service for distributed applications. It exposes a simple set of primitives that distributed applications can build upon to implement higher level services for synchronization, configuration maintenance, and groups and naming. It is designed to be easy to program to, and uses a data model styled after the familiar directory tree structure of file systems. It runs in Java and has bindings for both Java and C.
【要解决的问题:race conditions and deadlock】
Coordination services are notoriously hard to get right. They are especially prone to errors such as race conditions and deadlock. The motivation behind ZooKeeper is to relieve distributed applications the responsibility of implementing coordination services from scratch.
【core --- They maintain an in-memory image of state, along with a transaction logs and snapshots in a persistent store.】
The servers that make up the ZooKeeper service must all know about each other. They maintain an in-memory image of state, along with a transaction logs and snapshots in a persistent store. As long as a majority of the servers are available, the ZooKeeper service will be available.
zookeeper_action的更多相关文章
随机推荐
- Linux(一) 软件安装
前言:在Linux中安装软件时,我们经常要考虑到这样几个个问题: (1).怎样安装软件; (2).软件安装在什么地方; (3).如何卸载删除不要的软件...... 下面,我们就 ...
- PHP amqp扩展安装
1.安装 rabbitmq-c下载地址:https://github.com/alanxz/rabbitmq-c> mkdir build > cd build> cmake -DO ...
- ios获得文件字节总数
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.finalPath err ...
- 【redis】redis实现API接口调用调用次数的限制
redis实现API接口调用调用次数的限制 参考地址:https://bbs.csdn.net/topics/391856106?page=1 参考地址:https://www.cnblogs.com ...
- EasyMvc入门教程-高级控件说明(16)信息框控件
网页开发的时候,会经常向用户显示一些信息,比如执行结果,注意事项等,下面展示一种最简单的信息提示: 代码如下: @Html.Q().Msg().Text("初始化信息").Auto ...
- opencv-2.4.11编译备忘
编译完成后,想测试example中例子,但是由于没有sudo权限,不能运行pkg-config查看opencv的--cflags和--libs. 记录一下,备忘: pkg-config --libs ...
- Shell脚本部分语法
Shell中的变量 Linux Shell中的变量分为“系统变量”和“用户自定义变量”,可以通过set命令查看那系统变量 系统变量:$HOME.$PWD.$SHELL.$USER等等 显示当前sh ...
- windows的iis做后门,隐藏访问,无日志
windows下的iis5/iis6做后门,隐藏访问,不留访问记录或者不留日志 好不容易攻下一台Windows2000/2003 IIS服务器,你一定会想,怎样才能长期占有这个“肉鸡”呢?聪明的你肯定 ...
- hdu1198Farm Irrigation(dfs找联通)
题目链接: 啊哈哈,选我选我 思路是:首先依据图像抽象出联通关系.. 首先确定每一种图形的联通关系.用01值表示不连通与不连通... 然后从第1个图形进行dfs搜索.假设碰到两快田地能够联通的话那么标 ...
- OPENCV中数字图像处理知识运用
cvZero():是让矩阵的值都为0,有初始化的作用,或者说清零~比如说:IplImage img=cvCreateImage(cvSize(640,480),IPL_DEPTH_8U,1);%创建一 ...