Docker以其轻量化在开源社区刮起一阵阵旋风,据此它被称为下一代的虚拟机。 CoreOS是为docker定制的分布式系统,被称为下一代的Linux。 因此被CoreOS和Kubernetes(docker的管理软件)使用的etcd不难引起人们的注意。
简介
为了共享配置和服务发现整的一个分布式键值存储系统。
etcd is a distributed, consistent key-value store for shared configuration and service discovery
为集群环境的服务发现和注册而设计,它提供了数据TTL失效、数据改变监视、多值、目录监听、分布式锁原子操作等功能,可以方便的跟踪并管理集群节点的状态。
熟悉ZooKeeper的同学肯定不会陌生:
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
使用raft算法, with a focus on being:
Simple: curl’able user facing API (HTTP+JSON) Secure: optional SSL client cert authentication Fast: benchmarked 1000s of writes/s per instance Reliable: properly distributed using Raft
术语
NODE 指的是一个raft状态机实例,拥有唯一标识。在处于leading状态时记录其他节点的步进数。 MEMBER 指的是一个etcd实例,运行在node上,向node上的应用程序提供服务。 CLUSTER 多个member构成一个cluster,每个member中的node遵循raft共识协议来复制日志,cluster接受来自member的提案消息,将其提交保存至本地磁盘。 PEER 同一cluster中其他member CLINET 调用cluster api的对象
产品使用
etcd is being used successfully by many companies in production. It is, however, under active development, and systems like etcd are difficult to get correct. If you are comfortable with bleeding-edge software, please use etcd and provide us with the feedback and testing young software needs.
参考文献
http://blog.scottlowe.org/2015/04/15/running-etcd-20-cluster/
http://www.infoq.com/cn/articles/etcd-interpretation-application-scenario-implement-principle