Version v3.6-DRAFT of the documentation is in DRAFT status. For the latest stable documentation, see v3.5.
How to create locks
Guide to creating distributed locks in etcd
LOCK acquires a distributed mutex with a given name. Once the lock is acquired, it will be held until etcdctl is terminated.
Prerequisites
- Install
etcd
andetcdctl
Creating a lock
lock
for distributed lock:
etcdctl --endpoints=$ENDPOINTS lock mutex1
Options
- endpoints - defines a comma-delimited list of machine addresses in the cluster.
- ttl - time out in seconds of lock session.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.