Loading

摘要: 5.模拟美团商家上下线 5.1 需求 模拟美团服务平台,商家营业通知,商家打烊通知 提前在根节点下,创建好 /meituan 节点 5.2 商家服务类 public class ShopServer { private static String connectString = "192.168.2 阅读全文
posted @ 2021-06-07 22:49 Pen9 阅读(54) 评论(0) 推荐(0)
摘要: 4. Zookeeper 实战 4.1 分布式安装部署 集群思路:先搞定一台服务器,再克隆出两台,形成集群! 4.1.1 安装zookeeper 详情见:Learning Zookeeper systematically - part 2 - install 4.1.2 配置服务器编号 在/opt/ 阅读全文
posted @ 2021-06-07 21:49 Pen9 阅读(55) 评论(0) 推荐(0)
摘要: 3. Zookeeper内部原理 3.1 选举机制 半数机制:集群中半数以上机器存活,集群可用。所以Zookeeper适合安装奇数台服务器 虽然在配置文件中并没有指定Master和Slave。但是,Zookeeper工作时,是有一个节点为 Leader,其他则为Follower,Leader是通过内 阅读全文
posted @ 2021-06-07 20:23 Pen9 阅读(38) 评论(0) 推荐(0)