Skip to content

Instantly share code, notes, and snippets.

@tjdett
Created February 6, 2015 02:20
Show Gist options
  • Save tjdett/103ef6eed9c35c5576a0 to your computer and use it in GitHub Desktop.
Save tjdett/103ef6eed9c35c5576a0 to your computer and use it in GitHub Desktop.
etcd out-by-one indexes

Set value:

core@pn-02 ~ $ ETCDCTL_PEERS=http://127.0.0.1:2379/ /opt/etcd/etcdctl set /test-`date +"%s"` "tjdett: but if that one machine isn\'t getting state replicated then it could be behind"

Get cluster-wide state:

$ ansible routing -i inventory.ini --sudo -a "curl -s http://localhost:2379/v2/keys/test-1423189078"
pn-04.resbaz.cloud.edu.au | success | rc=0 >>
{"action":"get","node":{"key":"/test-1423189078","value":"tjdett: but if that one machine isn't getting state replicated then it could be behind","modifiedIndex":456,"createdIndex":456}}

pn-05.resbaz.cloud.edu.au | success | rc=0 >>
{"action":"get","node":{"key":"/test-1423189078","value":"tjdett: but if that one machine isn't getting state replicated then it could be behind","modifiedIndex":456,"createdIndex":456}}

pn-03.resbaz.cloud.edu.au | success | rc=0 >>
{"action":"get","node":{"key":"/test-1423189078","value":"tjdett: but if that one machine isn't getting state replicated then it could be behind","modifiedIndex":456,"createdIndex":456}}

pn-01.resbaz.cloud.edu.au | success | rc=0 >>
{"action":"get","node":{"key":"/test-1423189078","value":"tjdett: but if that one machine isn't getting state replicated then it could be behind","modifiedIndex":456,"createdIndex":456}}

pn-02.resbaz.cloud.edu.au | success | rc=0 >>
{"action":"get","node":{"key":"/test-1423189078","value":"tjdett: but if that one machine isn't getting state replicated then it could be behind","modifiedIndex":455,"createdIndex":455}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment