mirror of https://github.com/docker/cli.git
add replicated in service scale command description
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
1814d5121e
commit
ef09aafc3e
|
@ -1075,7 +1075,7 @@ __docker_service_commands() {
|
||||||
"inspect:Display detailed information on one or more services"
|
"inspect:Display detailed information on one or more services"
|
||||||
"ls:List services"
|
"ls:List services"
|
||||||
"rm:Remove one or more services"
|
"rm:Remove one or more services"
|
||||||
"scale:Scale one or multiple services"
|
"scale:Scale one or multiple replicated services"
|
||||||
"ps:List the tasks of a service"
|
"ps:List the tasks of a service"
|
||||||
"update:Update a service"
|
"update:Update a service"
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,7 +18,7 @@ keywords: ["service, scale"]
|
||||||
```markdown
|
```markdown
|
||||||
Usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]
|
Usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]
|
||||||
|
|
||||||
Scale one or multiple services
|
Scale one or multiple replicated services
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--help Print usage
|
--help Print usage
|
||||||
|
@ -28,8 +28,9 @@ Options:
|
||||||
|
|
||||||
### Scale a service
|
### Scale a service
|
||||||
|
|
||||||
The scale command enables you to scale one or more services either up or down to
|
The scale command enables you to scale one or more replicated services either up
|
||||||
the desired number of replicas. The command will return immediately, but the
|
or down to the desired number of replicas. This command cannot be applied on
|
||||||
|
services which are global mode. The command will return immediately, but the
|
||||||
actual scaling of the service may take some time. To stop all replicas of a
|
actual scaling of the service may take some time. To stop all replicas of a
|
||||||
service while keeping the service active in the swarm you can set the scale to 0.
|
service while keeping the service active in the swarm you can set the scale to 0.
|
||||||
|
|
||||||
|
@ -40,6 +41,15 @@ $ docker service scale frontend=50
|
||||||
frontend scaled to 50
|
frontend scaled to 50
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The following command tries to scale a global service to 10 tasks and returns an error.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker service create --mode global --name backend backend:latest
|
||||||
|
b4g08uwuairexjub6ome6usqh
|
||||||
|
$ docker service scale backend=10
|
||||||
|
backend: scale can only be used with replicated mode
|
||||||
|
```
|
||||||
|
|
||||||
Directly afterwards, run `docker service ls`, to see the actual number of
|
Directly afterwards, run `docker service ls`, to see the actual number of
|
||||||
replicas.
|
replicas.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue