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的更多相关文章
随机推荐
- 转:IAdaptable & IAdapterFactory
IAdaptable & IAdapterFactory在Eclipse中使用IAdaptable接口的方式有两种 在Eclipse中使用IAdaptable接口的方式有两种1:某个类希望提供 ...
- PHP如何在页面中原样输出HTML代码
字符串与HTML之间的相互转换主要应用htmlentities()函数来完成. header("Content-Type: text/html; charset=utf-8"); ...
- rownum详解
对于rownum来说它是oracle系统顺序分配为从查询返回的行的编号,返回的第一行分配的是1,第二行是2,依此类推,这个伪字段可以用于限制查询返回的总行数,且rownum不能以任何表的名称作为前缀. ...
- 从C的声明符到Objective-C的Blocks语法
原文链接:http://nilsou.com/blog/2013/08/21/objective-c-blocks-syntax/ 在这个post中,我先以C简单和内置复杂的声明开始,直到我们开始接触 ...
- How To Use Git Source Control with Xcode in iOS 6
This tutorial is by Malek Trabelsi, a passionate iOS developer from Tunisia focused primarily on mob ...
- windows下用vscode写C++
[本文参考:https://www.cnblogs.com/zhuzhenwei918/p/9057289.html 和 https://www.zhihu.com/question/3031589 ...
- Linux下防火墙iptables用法规则详及其防火墙配置
转:http://www.linuxidc.com/Linux/2012-08/67952.htm iptables规则 规则--顾名思义就是规矩和原则,和现实生活中的事情是一样的,国有国法,家有家规 ...
- qs库使用
1.npm地址 https://www.npmjs.com/package/qs 2.概述 将url中的参数转为对象: 将对象转为url参数形式 3.示例 import qs from 'qs'; c ...
- iOS之手势滑动返回功能
iOS中如果不自定义UINavigationBar,通过手势向右滑是可以实现返回的,这时左边的标题文字提示的是上一个ViewController的标题,如果需要把文字改为简约风格,例如弄过箭头返回啥的 ...
- java 接口回调
学习自:http://blog.csdn.net/xiaanming/article/details/8703708/ http://hellosure.iteye.com/blog/1130176 ...