We're excited to release version 0.3.0 of etcd, a highly-available key value store for shared configuration and service discovery. Read on to learn about the changes in this release or hop over to GitHub to download the latest binaries.
The Discovery API automates the process of bootstrapping a cluster. In previous releases, a human had to pick a leader, pass a list of
-peers to all of the followers and maintain that list going forward. The Discovery API takes a unique token as an input and fetches a list of peers that have already been registered with that token. If no peers have ever existed, the first peer to use that token will assume leadership of the cluster. Stale peers will be cleaned up automatically to allow you to use the same token as machines come and go.
Other API Additions
This release does not break the existing v2 API but it does add two new features:
CompareAndDelete: etcd has let you create and update keys atomically but this release introduces atomic deletes too. This means that you can delete a key only if certain prerequisites like its index or value are correct.
prevNode: write requests will now return a prevNode field next to the existing node field. This entry represents the state of this key before the write was made and is useful for many uses like using a key as a simple atomic queue without a GET and PUT.
We added an event-based logging system to get details about leader elections and cluster changes out of the core consensus system of etcd. This gives admins more clear and helpful information about the cluster state via log files.
go get and Windows Support
We recently moved to using
goven for dependency management in etcd which means a few things:
go get github.com/coreos/etcdworks and is a fast way to grab master
- Go cross compilation works and etcd now has official Windows builds
Changes to Functionality
Goodbye info File
info file was removed and is no longer used. This file was a cache of command line arguments and was causing a lot of confusion and bug reports. If you have an info file in your etcd data directory you can safely remove it.
Snapshots by Default
etcd uses a replicated log that is managed by the Raft consensus protocol. During normal usage, every write causes an entry to be appended to the log. In previous releases, the entire log was stored in memory, which caused memory usage to grow over the life of the cluster.
In this release we enabled
-snapshot=true by default. This means that periodically etcd will flush older logs from memory to reduce resource usage.
Minor Fixes and Improvements
- /mod/dashboard was refactored to improve the code quality
- tracing options were added to enable use of pprof, graphite and other debugging methods
- An etcd client matrix was added
- Statistics APIs were documented
- Improvements to the goraft locking code and leader step down code
- Fixes to the internal watch datastructures and locks