ZooKeeper 替代品?(集群协调服务) [英] ZooKeeper alternatives? (cluster coordination service)

查看:36
本文介绍了ZooKeeper 替代品?(集群协调服务)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ZooKeeper 是一种用于数据中心的高度可用的协调服务.它起源于 Hadoop 项目.可以在其上实现锁定、故障转移、领导者选举、组成员身份和其他协调问题.ZooKeeper 有其他替代方案吗?(当然是免费软件)

ZooKeeper is a highly available coordination service for data centers. It originated in the Hadoop project. One can implement locking, fail over, leader election, group membership and other coordination issues on top of it. Are there any alternatives to ZooKeeper? (free software of course)

推荐答案

我广泛地研究了 Zookeeper/Curator, Eurekaetcd 和 consul.如果您在 Java 世界中,Zookeeper/Curator 和 Eureka 在许多方面都是最精致且最容易集成的.Etcd 非常酷且非常灵活,但它实际上只是一个 HA 密钥存储,因此您必须编写大量代码才能把它变成一个固执己见的服务发现系统.

I've looked extensively at Zookeeper/Curator, Eureka, etcd, and consul. Zookeeper/Curator and Eureka are in many ways the most polished and easiest to integrate if you are in the Java world. Etcd is pretty cool and very flexible, but It is really just a HA key store so you would have to write a lot of code to turn it into an opinionated service discovery system.

Consul 是(对我而言)两全其美的.它是一个写在 serf 之上的自以为是的服务发现系统,使用 raft 进行集群共识,使用 gossip 进行通信.它使用文档齐全的 REST api 公开发现/注册端点,还允许您使用 DNS SRV 记录发现服务,并使用配置注册服务(即,您可以注册无法与客户端集成的数据库或应用程序,或者,如果您只是想让您的服务发现与您的应用分离)

Consul is (to me) the best of both worlds. It is an opinionated service discovery system written on top of serf, using raft for cluster consensus and gossip for communication. It exposes the discovery / registration endpoints with a well documented REST api, and also allows you to discover services with DNS SRV records, and register services with configuration (i.e. so you can register a database or application you can't integrate a client with, or if you just want to keep your service discovery decoupled from your app)

我写了一篇关于 consul 的博客文章,其中您可以了解更多信息并浏览我的试用"演示

I've written a blog post about consul where you can learn more and walk through my "try it out" demo

我还讨论了 使用 etcd & 的服务发现;docker 如果您想了解更多有关该自定义代码的外观的信息.

I've also discussed service discovery with etcd & docker if you want to see more about what that custom code might look like.

最后一件事!等consul 是用 go 编写的,因此维护它们比像 zookeeper 这样的 Java 解决方案要容易得多.您只需要 consul/etcd 二进制文件.没有依赖,没有链接库,没有 jvm.

One last thing! etcd & consul are written in go, so maintaining them is much easier then java solutions like zookeeper. All you need is the consul / etcd binary. no dependencies, no linked libraries, no jvm.

这篇关于ZooKeeper 替代品?(集群协调服务)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆