etcd2 on Compose
etcd2 is being deprecated
With the release of etcd3 from beta, Compose will soon no longer support etcd2 on the platform. As of January 2018 provisioning of new etcd2 deployments is disabled.
The deprecation schedule is:
February 1st, 2018 - Official EOL
May 1st, 2018 - Start spinning down deployments.Please plan on upgrading or deprovisioning your etcd2 deployments accordingly.
etcd is a distributed key/value store with an emphasis on consistency. Using the RAFT consensus algorithm to coordinate all the nodes, queries to etcd are assured to get the correct answer. Combined with TTL expiry, ACID compare-and-swap operations and watch monitoring, this emphasis on correctness has made etcd2 a leader in configuration management databases.
etcd for All is a general introduction to etcd on Compose.
Are you wondering what you'll get, or can get, with a Compose etcd deployment? Want to know what you'll need to do to manage it? Check out some of the implementation features and details down in etcd for Ops and Admins.
Just deployed etcd and want to get coding with it? Developing an application or want to try a new stack? Then see the etcd for Developers section for resources on how to connect from different languages, command line tools and more information to get you started.
etcd for All
When deployed on Compose, etcd has comes with these standard Compose features.
- Automatically scaling server stack that scales RAM, CPU, and I/O as your etcd data grows.
- Daily, weekly, monthly, and on-demand backups.
- Metrics displayed in the Compose UI
- Deploy, manage, backup, and otherwise automate database tasks through the The Compose API.
- Guaranteed resources per deployment.
- Daily logs available for download.
Compose deployments of etcd also come with a number of etcd specific features:
- Data Browser For etcd.
- An optional add-on for real-time log access.
- Start with 256MB for $28.50 - as you grow each additional 256MB unit costs $19.50.
Compose Configuration
An etcd deployment starts with three etcd data members; each member with 256MB memory and 256MB storage. Also included are two HAProxy portals to manage connections and high-availability at 64MB memory each.
Expansion Options
etcd deployments may be vertically scaled with additional storage and memory added to each node. The HAProxy portals may also be scaled with more memory.
Datacenter Availability
See Compose Datacenter Availability for current location availability.
Billing and Costs
Compose deployments are billed based on disk usage and your etcd deployment usage is measured hourly. It is then grouped into a single monthly billing cycle. This means that any scaling or add-on usage will be charged from when the new resource was provisioned; not just for the month. You can see your deployment's usage in the Overview panel, under Current Usage.
For Ops and Admins
High-availability and Failover Details
In an etcd cluster each member knows about every other member and relies on a distributed consensus protocol to determine the leader. The leader send out information about its leader status at a set interval. The followers, if nothing has been heard from the leader, all have their own interval after which they will attempt to become a leader. The two HAProxy portals will automatically handle incoming connections regardless of which member of the cluster is leader and should one HAProxy go down your application can fail-over to the other portal.
2GB Storage Limit
etcd has a default storage limit set by the developers to ensure reliable recovery in failover scenarios. If a node were to grow to large, it would spend too long recovering its data from disk, and then when syncing to the other nodes, place too much load on them. The limit of 2GB makes recovery fast, effective and avoids this issue.
For Developers
CLI Tools
There are two methods to communicate with and administrate etcd. Since etcd2 uses REST, it is possible just use cURL. The other method, etcdctl, is the command-line utility and is available through a local installation of etcd.
Connecting to etcd
The Overview panel of the Compose UI provides the basic information you need to get connected to your databases. In the section Connection info you will find Credentials and Connection Strings for your application.
Our etcd deployments are SSL-enabled using Let's Encrypt certificates. More information on getting your applications connected is on the Connecting to etcd2 page.
Features for your etcd2 Application
- Wait For Changes: By sending GET requests with a 'wait=true' enabled, you will actively poll the queried key until the value changes. You will know immediately when values in your deployment have changed.
- Time-To-Live: Directories can be created with a TTL value - a set expiry date. Working with encryption, or distributed configuration management is a great fit for etcd.
- Acid Compare-And-Swap & Compare-And-Delete: Atomic compare-and operations check to make sure the value is something expected before executing any changes in a single operation. Otherwise the operation returns an error, ensuring consistent state.
Additional Resources and Related Articles
The full list of documentation for etcd is in the sidebar, in addition to all things Compose.
For more than just help docs, check out Compose Articles and our curated collection of etcd-related topics for more how-to's and information on etcd on Compose.
Still Need Help?
If this article didn't solve things, summon a human and get some help!
Updated over 3 years ago