如果一名动物园管理员死了,我应该期待什么行为?
If one zookeeper dies, what behavior shall I expect?
有没有办法在 zookeeper 服务器上创建 watch?如果我有 5 个动物园管理员服务器,并且如果一个追随者死亡,我应该期待什么行为?现有的请求会被中止吗?或者其他动物园管理员会处理这些?
客户端应该如何透明地移动到另一个zookeeper?
米娜
Is there a way we can create watch on zookeeper serevers themselves?
不,监视仅在 znodes 上设置,znodes 是客户端写入 ZooKeeper 集群的数据项。没有机制让客户端接收集群中服务器停止的自动通知。
If i have 5 zookeeper servers, and if one follower dies what behavior shall I expect?
在跟随者死亡时连接到跟随者的客户端将使用不同的服务器重新连接到 ZooKeeper 集群。只要仍然有可用服务器的法定人数,集群将保持读写流量的功能。如果该服务器稍后重新启动并重新联机,那么它将与一个好的服务器重新同步以赶上错过的交易。
Would the existing requestes be aborted? Or another zookeeper would take care of these? How should the client can be moved to another zookeeper transparently?
对于正确编码的 ZooKeeper 客户端应用程序,错误处理将重新连接到集群中的不同服务器并继续其事务。 ZooKeeper 客户端在内部与它连接的服务器进行心跳。如果连接丢失,则会向客户端发送一个 "connection loss" 事件。这是客户端重新建立任何所需状态的机会。
有关更多详细信息,我建议通读 ZooKeeper Programmer's Guide and Recipes and Solutions, which contain working examples of typical use cases with correct error handling and recovery. Another potential consideration is to use the Apache Curator 库,其中包含分布式锁等更高级别构造的有效实现,以及正确的错误处理和恢复。
有没有办法在 zookeeper 服务器上创建 watch?如果我有 5 个动物园管理员服务器,并且如果一个追随者死亡,我应该期待什么行为?现有的请求会被中止吗?或者其他动物园管理员会处理这些?
客户端应该如何透明地移动到另一个zookeeper?
米娜
Is there a way we can create watch on zookeeper serevers themselves?
不,监视仅在 znodes 上设置,znodes 是客户端写入 ZooKeeper 集群的数据项。没有机制让客户端接收集群中服务器停止的自动通知。
If i have 5 zookeeper servers, and if one follower dies what behavior shall I expect?
在跟随者死亡时连接到跟随者的客户端将使用不同的服务器重新连接到 ZooKeeper 集群。只要仍然有可用服务器的法定人数,集群将保持读写流量的功能。如果该服务器稍后重新启动并重新联机,那么它将与一个好的服务器重新同步以赶上错过的交易。
Would the existing requestes be aborted? Or another zookeeper would take care of these? How should the client can be moved to another zookeeper transparently?
对于正确编码的 ZooKeeper 客户端应用程序,错误处理将重新连接到集群中的不同服务器并继续其事务。 ZooKeeper 客户端在内部与它连接的服务器进行心跳。如果连接丢失,则会向客户端发送一个 "connection loss" 事件。这是客户端重新建立任何所需状态的机会。
有关更多详细信息,我建议通读 ZooKeeper Programmer's Guide and Recipes and Solutions, which contain working examples of typical use cases with correct error handling and recovery. Another potential consideration is to use the Apache Curator 库,其中包含分布式锁等更高级别构造的有效实现,以及正确的错误处理和恢复。