News for hackers. Stuff that matters.
Re:Consul 1.0 Released by takeda on Monday October 16, 2017 @07:31PM (#15487505)
Yes, but that's only to detect whether node is up or down, the health checks are still strongly consistent and go through the servers.

Because of this design, the don't get benefits of any of them.

Side note, KV is actually strongly consistent, which is what is desired, the thing is that since KV comes with consul it encourages people to use it.

One just need to keep in mind, that Raft and Paxos expect all nodes to be updated on every change (e.g. if you have 5 server node cluster all 5 nodes need to "sign on it" before it is accepted). This is counter-intuitive since adding nodes to cluster makes it actually slower (the goal is correctness and resilience not performance). Basically you just need to keep in mind to not use KV for some write heavy operations. Serving configuration files generally is fine.

Re:Consul 1.0 Released by cube2222 on Tuesday October 17, 2017 @04:19AM (#15489399)
In both paxos and raft you only need a quorum to sign on it. In the case of raft/consul it's the majority. Which means, you need 3 of 5 nodes to sign on it.

Also, key value store reads are usually done locally, from the agent, which goes over gossip and is eventually consistent.

Health checks are also eventually consistent. They are done by the local agent, and through gossip are sent to the masters group.

Re:Consul 1.0 Released by takeda on Tuesday October 17, 2017 @04:58PM (#15494874)
I'm aware that Paxos and Raft require odd number of nodes. My point was that the more nodes you have the slower the cluster is, because increasing number of the nodes doesn't increase performance but resilience. With 3 nodes you can afford to lose at most 1 node, with 5 -> 2, with 7 -> 3 etc.

> Also, key value store reads are usually done locally, from the agent, which goes over gossip and is eventually consistent.

That's not what the documentation says. The KV is using raft, you can relax some guarantees for reading by having clients use consistency=stale, but you're still communicating with the server, except in stale you only communicate with one instead all of them.

> Health checks are also eventually consistent. They are done by the local agent, and through gossip are sent to the masters group.

Also that's not what the documentation says. Gossip is used for adding/removing nodes and the overall health of the node (whether host is reachable) is also done through gossip, but the actual health checks (whether a service is running) is done through consensus protocol.

I still want to emphasize that using consensus protocol for SD is not a good idea. Let say you're running in AWS and follow the best practices which is spreading your servers over multiple AZ. Let say you use us-east-1 which has 6 AZ.

An AWS starts having network issues (like few months ago) and 2 AZs have network issues and can't communicate with the rest. The machines are still running, just can't communicate. It just happens that on 2 of those AZs you run 2 out of your 3 consul servers. Even though all the machines are healthy and running your Consul cluster is down, even for the remaining 4 AZs that don't have any problems.

Re:Consul 1.0 Released by hamandcheese on Thursday October 19, 2017 @06:03AM (#15506680)
You should probably have a Consul server in each availability zone if you want to protect against this type of failure.

Consul uses one raft cluster per "datacenter", so you don't have to worry about write performance seriously degrading as you scale, it will only be up to the max of the number of availability zones you'd like to operate in per region. Plus you shouldn't be doing write heavy KV operations with consul anyway.

Just because you are using strong consistency doesn't mean you can't get reasonably high availability in practice.

Re:Consul 1.0 Released by scarface74 on Wednesday October 18, 2017 @08:03AM (#15498366)
That's not what the documentation says. The KV is using raft, you can relax some guarantees for reading by having clients use consistency=stale, but you're still communicating with the server, except in stale you only communicate with one instead all of them.

How do you come to the conclusion that you're communicating with the server? When I'm doing any type of communications with consul via the API I'm always communicating with 127.0.0.1/....

Re:Consul 1.0 Released by hamandcheese on Thursday October 19, 2017 @06:04AM (#15506682)
Local agents forward to your central consul servers.