Hacker News new | ask | show | jobs
by mitchellh 4440 days ago
Thanks for prefacing the constructive criticism with the compliment. :)

I want to clarify: Of all the buzz words Consul has, one thing Consul ISN'T is decentralized. You must run at least one Consul server in a cluster. If you want a fully centralized approach, you can just run one server. No big deal. Of course, if that server goes down, reads/writes are unavailable. If you want high availability, you run multiple servers. They leader elect to determine who will handle the writes but that is about it.

It is "decentralized" in that you can send read/writes to any server, but those servers actually just forward the requests onto the leader.

1 comments

Oh, well i'm a giant ass then. I saw "completely distributed" and extrapolated decentralized from that. Still, an automatically-[randomly?]-elected leader in a distributed network is a form of decentralized network. It's effectively a toroidal network topology, since your datacenters make it multi-dimensional (though now that I look at hypercubes i'm not exactly sure which is a better fit here)

Now that i've re-read your architecture page, let me see if I understand this: the basic point behind using Consul is to have multiple servers agree on the result of a request, and communicate that agreement to a single node to write it, and then return it to the client. So really it's a fault-tolerant messaging platform that includes features that take advantage of such a network; do I have that right?

Also, your docs say there are between three and five servers, but here you're saying you only need one?

We recommend three or five because that will get you a high level of fault tolerance. Consul runs just fine with one server, but you'll have no fault tolerance: if that one server becomes unavailable for any reason, then reads/writes for your cluster will not be served.

The leader is elected using Raft as the consensus algorithm (it is linked in the internals section of the docs).

You are correct though that if you run multiple servers, the leader election will happen automatically. There is no way to manually override it.