mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Documentation/dev-guide: add bash syntax to doc
This commit is contained in:
parent
918af500c3
commit
adbd936f22
@ -150,6 +150,7 @@ etcdctl put foo1 bar1_new # revision = 5
|
|||||||
```
|
```
|
||||||
|
|
||||||
Here is an example to watch the historical changes:
|
Here is an example to watch the historical changes:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# watch for changes on key `foo` since revision 2
|
# watch for changes on key `foo` since revision 2
|
||||||
$ etcdctl watch --rev=2 foo
|
$ etcdctl watch --rev=2 foo
|
||||||
@ -188,7 +189,7 @@ 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
|
||||||
# grant a lease with 10 second TTL
|
# grant a lease with 10 second TTL
|
||||||
$ etcdctl lease grant 10
|
$ etcdctl lease grant 10
|
||||||
lease 32695410dcc0ca06 granted with TTL(10s)
|
lease 32695410dcc0ca06 granted with TTL(10s)
|
||||||
@ -204,7 +205,7 @@ 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
|
||||||
$ etcdctl lease grant 10
|
$ etcdctl lease grant 10
|
||||||
lease 32695410dcc0ca06 granted with TTL(10s)
|
lease 32695410dcc0ca06 granted with TTL(10s)
|
||||||
$ etcdctl put --lease=32695410dcc0ca06 foo bar
|
$ etcdctl put --lease=32695410dcc0ca06 foo bar
|
||||||
@ -213,7 +214,7 @@ OK
|
|||||||
|
|
||||||
Here is the command to revoke the same lease:
|
Here is the command to revoke the same lease:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ etcdctl lease revoke 32695410dcc0ca06
|
$ etcdctl lease revoke 32695410dcc0ca06
|
||||||
lease 32695410dcc0ca06 revoked
|
lease 32695410dcc0ca06 revoked
|
||||||
|
|
||||||
@ -227,14 +228,14 @@ 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
|
||||||
$ etcdctl lease grant 10
|
$ etcdctl lease grant 10
|
||||||
lease 32695410dcc0ca06 granted with TTL(10s)
|
lease 32695410dcc0ca06 granted with TTL(10s)
|
||||||
```
|
```
|
||||||
|
|
||||||
Here is the command to keep the same lease alive:
|
Here is the command to keep the same lease alive:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ etcdctl lease keep-alive 32695410dcc0ca0
|
$ etcdctl lease keep-alive 32695410dcc0ca0
|
||||||
lease 32695410dcc0ca0 keepalived with TTL(100)
|
lease 32695410dcc0ca0 keepalived with TTL(100)
|
||||||
lease 32695410dcc0ca0 keepalived with TTL(100)
|
lease 32695410dcc0ca0 keepalived with TTL(100)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user