mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
doc: add lease time
The current lease time is short and as such can lead to a timeout error as explained in the related issue which can be confusing. Fixes #9726
This commit is contained in:
parent
a4e9d81df7
commit
9002c1951f
@ -408,9 +408,9 @@ Applications can grant leases for keys from an etcd cluster. When a key is attac
|
|||||||
Here is the command to grant a lease:
|
Here is the command to grant a lease:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# grant a lease with 10 second TTL
|
# grant a lease with 60 second TTL
|
||||||
$ etcdctl lease grant 10
|
$ etcdctl lease grant 60
|
||||||
lease 32695410dcc0ca06 granted with TTL(10s)
|
lease 32695410dcc0ca06 granted with TTL(60s)
|
||||||
|
|
||||||
# attach key foo to lease 32695410dcc0ca06
|
# attach key foo to lease 32695410dcc0ca06
|
||||||
$ etcdctl put --lease=32695410dcc0ca06 foo bar
|
$ etcdctl put --lease=32695410dcc0ca06 foo bar
|
||||||
@ -424,8 +424,8 @@ Applications revoke leases by lease ID. Revoking a lease deletes all of its atta
|
|||||||
Suppose we finished the following sequence of operations:
|
Suppose we finished the following sequence of operations:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ etcdctl lease grant 10
|
$ etcdctl lease grant 60
|
||||||
lease 32695410dcc0ca06 granted with TTL(10s)
|
lease 32695410dcc0ca06 granted with TTL(60s)
|
||||||
$ etcdctl put --lease=32695410dcc0ca06 foo bar
|
$ etcdctl put --lease=32695410dcc0ca06 foo bar
|
||||||
OK
|
OK
|
||||||
```
|
```
|
||||||
@ -447,17 +447,17 @@ Applications can keep a lease alive by refreshing its TTL so it does not expire.
|
|||||||
Suppose we finished the following sequence of operations:
|
Suppose we finished the following sequence of operations:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ etcdctl lease grant 10
|
$ etcdctl lease grant 60
|
||||||
lease 32695410dcc0ca06 granted with TTL(10s)
|
lease 32695410dcc0ca06 granted with TTL(60s)
|
||||||
```
|
```
|
||||||
|
|
||||||
Here is the command to keep the same lease alive:
|
Here is the command to keep the same lease alive:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ etcdctl lease keep-alive 32695410dcc0ca06
|
$ etcdctl lease keep-alive 32695410dcc0ca06
|
||||||
lease 32695410dcc0ca06 keepalived with TTL(10)
|
lease 32695410dcc0ca06 keepalived with TTL(60)
|
||||||
lease 32695410dcc0ca06 keepalived with TTL(10)
|
lease 32695410dcc0ca06 keepalived with TTL(60)
|
||||||
lease 32695410dcc0ca06 keepalived with TTL(10)
|
lease 32695410dcc0ca06 keepalived with TTL(60)
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -533,8 +533,8 @@ Prints a message with the granted lease ID.
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./etcdctl lease grant 10
|
./etcdctl lease grant 60
|
||||||
# lease 32695410dcc0ca06 granted with TTL(10s)
|
# lease 32695410dcc0ca06 granted with TTL(60s)
|
||||||
```
|
```
|
||||||
|
|
||||||
### LEASE REVOKE \<leaseID\>
|
### LEASE REVOKE \<leaseID\>
|
||||||
@ -609,8 +609,8 @@ Prints a message with a list of active leases.
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./etcdctl lease grant 10
|
./etcdctl lease grant 60
|
||||||
# lease 32695410dcc0ca06 granted with TTL(10s)
|
# lease 32695410dcc0ca06 granted with TTL(60s)
|
||||||
|
|
||||||
./etcdctl lease list
|
./etcdctl lease list
|
||||||
32695410dcc0ca06
|
32695410dcc0ca06
|
||||||
|
Loading…
x
Reference in New Issue
Block a user