Coordinate concurrent operations safely across your cluster. Prevent race conditions and ensure only one critical operation runs at a time.
You're migrating a database schema across 10 application servers. Only ONE server should run the migration at a time. Quorum-based locking ensures this.
# Acquire lock (requires majority agreement)
$ curl -X POST /api/v1.0/lock \
-d '{
"scope": "db-migration",
"action": "lock"
}'
{
"status": "locked",
"scope": "db-migration",
"quorum": "6/10 nodes agreed",
"holder": "migration-orchestration-001"
}
# Release lock
$ curl -X POST /api/v1.0/lock \
-d '{
"scope": "db-migration",
"action": "unlock"
}'
Unlike Kubernetes' single etcd master, this is truly distributed.
Interactive shell for managing locks without writing code:
manager lock acquire --scope SCOPEmanager lock status --scope SCOPEmanager lock release --scope SCOPEDShell provides a clean interface for HTTP APIs. Perfect for ops teams who prefer CLI over REST.
# Start interactive dshell
$ dshell -s cluster-node-1 -p 20194 -u admin
# Acquire distributed lock
dshell> manager lock acquire --scope db-migration
Lock acquired. Holder: dshell-session-001
# Check lock status
dshell> manager lock status --scope db-migration
LOCKED by dshell-session-001 (5/7 nodes)
# Release lock
dshell> manager lock release --scope db-migration
Lock released
# Batch mode for scripts
$ dshell manager lock acquire --scope db-migration
{
"name": "safe-db-migration",
"steps": [
{
"name": "acquire-lock",
"action_type": "http",
"method": "POST",
"url": "https://node/api/v1.0/lock",
"body": {
"scope": "db-migration",
"action": "lock"
}
},
{
"name": "run-migration",
"action_type": "shell",
"code": "alembic upgrade head"
},
{
"name": "release-lock",
"action_type": "http",
"method": "POST",
"url": "https://node/api/v1.0/lock",
"body": {
"scope": "db-migration",
"action": "unlock"
}
}
]
}
Use locks to coordinate multi-step operations:
Prevent race conditions without a central coordinator.
Quorum agreement ensures correctness even if nodes fail.
Locks auto-release if holder crashes.
Multiple independent locks for different resources.