Skip to content

Commit

Permalink
website: Cleanup the 'lock' documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Jan 22, 2015
1 parent cf04d6a commit d478f78
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions website/source/docs/commands/lock.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ layout: "docs"
page_title: "Commands: Lock"
sidebar_current: "docs-commands-lock"
description: |-
The lock command provides a mechanism for leader election, mutual exclusion,
or worker pools. For example, this can be used to ensure a maximum number of
services running at once across a cluster.
The lock command provides a mechanism for leader election, mutual exclusion, or worker pools. For example, this can be used to ensure a maximum number of services running at once across a cluster.
---

# Consul Lock
Expand All @@ -25,6 +23,9 @@ If the lock holder count is more than one, then a semaphore is used instead.
A semaphore allows more than a single holder, but the is less efficient than
a simple lock. This follows the [semaphore algorithm](/docs/guides/semaphore.html).

All locks using the same prefix must agree on the value of `-n`. If conflictling
values of `-n` are provided, an error will be returned.

An example use case is for highly-available N+1 deployments. In these
cases, if N instances of a service are required, N+1 are deployed and use
consul lock with `-n=N` to ensure only N instances are running. For singleton
Expand All @@ -50,7 +51,7 @@ The list of available flags are:

* `-n` - Optional, limit of lock holders. Defaults to 1. The underlying
implementation switches from a lock to a semaphore when increased past
one.
one. All locks on the same prefix must use the same value.

* `-name` - Optional name to associate with the underlying session.
If not provided, one is generated based on the child command.
Expand Down

0 comments on commit d478f78

Please sign in to comment.