Skip to content

Instantly share code, notes, and snippets.

@relistan
Created May 29, 2014 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save relistan/53be1fc306543df4ffdd to your computer and use it in GitHub Desktop.
Save relistan/53be1fc306543df4ffdd to your computer and use it in GitHub Desktop.
etcd service discovery and configuration schema
client.set('/services/fooservice/ports/3021', value: 9292)
client.set('/services/fooservice/env/TESTING_URL', value: 'http//foo.com/asdf')
client.set('/services/fooservice/hosts/chi-staging-foo-1.nr-ops.net', value: 'up')
client.set('/services/fooservice/hosts/chi-staging-foo-2.nr-ops.net', value: 'up')
client.set('/services/fooservice/hosts/chi-staging-foo-3.nr-ops.net', value: 'down')
client.set('/services/fooservice/endpoints/chi-staging-foo-1.nr-ops.net', value: 'http://chi-staging-foo-1.nr-ops.net:3021/')
client.set('/services/fooservice/endpoints/chi-staging-foo-2.nr-ops.net', value: 'http://chi-staging-foo-2.nr-ops.net:3021/')
client.set('/services/fooservice/endpoints/chi-staging-foo-3.nr-ops.net', value: 'http://chi-staging-foo-3.nr-ops.net:3021/')
I think that rather than hostnames, the endpoint and hosts keys should be a unique ID. Kelsey indicated that Google has an algorithm for generated a 12 letter key that is preyty unique. That might be a good option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment