Skip to content

Instantly share code, notes, and snippets.

@lazypower
Forked from mbruzek/leader.md
Last active November 24, 2015 22:09
Show Gist options
  • Save lazypower/dfbdf983cc1cf3c0f059 to your computer and use it in GitHub Desktop.
Save lazypower/dfbdf983cc1cf3c0f059 to your computer and use it in GitHub Desktop.

leader-set

leader-set immediately writes the key/value pairs to the juju controller, which will then inform non-leader units of the change. It will fail if called without arguments, or if called by a unit that is not currently service leader.

leader-set lets you write string key=value pairs, but with the following differences:

  • there's only one leader-settings bucket per service (not one per unit)
  • only the leader can write to the bucket
  • only minions are informed of changes to the bucket
  • changes are propagated instantly

The instant propagation may be surprising, but it exists to satisfy the use case where shared data can be chosen by the leader at the very beginning of the install hook.

It is strongly recommended that leader settings are always written as a self-consistent group leader-set one=one two=two three=three.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment