Signed-off-by: allencloud <allen.sun@daocloud.io>
| ... | ... |
@@ -16,7 +16,7 @@ import ( |
| 16 | 16 |
func newScaleCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 17 | 17 |
return &cobra.Command{
|
| 18 | 18 |
Use: "scale SERVICE=REPLICAS [SERVICE=REPLICAS...]", |
| 19 |
- Short: "Scale one or multiple services", |
|
| 19 |
+ Short: "Scale one or multiple replicated services", |
|
| 20 | 20 |
Args: scaleArgs, |
| 21 | 21 |
RunE: func(cmd *cobra.Command, args []string) error {
|
| 22 | 22 |
return runScale(dockerCli, args) |
| ... | ... |
@@ -1075,7 +1075,7 @@ __docker_service_commands() {
|
| 1075 | 1075 |
"inspect:Display detailed information on one or more services" |
| 1076 | 1076 |
"ls:List services" |
| 1077 | 1077 |
"rm:Remove one or more services" |
| 1078 |
- "scale:Scale one or multiple services" |
|
| 1078 |
+ "scale:Scale one or multiple replicated services" |
|
| 1079 | 1079 |
"ps:List the tasks of a service" |
| 1080 | 1080 |
"update:Update a service" |
| 1081 | 1081 |
) |
| ... | ... |
@@ -18,7 +18,7 @@ keywords: ["service, scale"] |
| 18 | 18 |
```markdown |
| 19 | 19 |
Usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...] |
| 20 | 20 |
|
| 21 |
-Scale one or multiple services |
|
| 21 |
+Scale one or multiple replicated services |
|
| 22 | 22 |
|
| 23 | 23 |
Options: |
| 24 | 24 |
--help Print usage |
| ... | ... |
@@ -28,8 +28,9 @@ Options: |
| 28 | 28 |
|
| 29 | 29 |
### Scale a service |
| 30 | 30 |
|
| 31 |
-The scale command enables you to scale one or more services either up or down to |
|
| 32 |
-the desired number of replicas. The command will return immediately, but the |
|
| 31 |
+The scale command enables you to scale one or more replicated services either up |
|
| 32 |
+or down to the desired number of replicas. This command cannot be applied on |
|
| 33 |
+services which are global mode. The command will return immediately, but the |
|
| 33 | 34 |
actual scaling of the service may take some time. To stop all replicas of a |
| 34 | 35 |
service while keeping the service active in the swarm you can set the scale to 0. |
| 35 | 36 |
|
| ... | ... |
@@ -40,6 +41,15 @@ $ docker service scale frontend=50 |
| 40 | 40 |
frontend scaled to 50 |
| 41 | 41 |
``` |
| 42 | 42 |
|
| 43 |
+The following command tries to scale a global service to 10 tasks and returns an error. |
|
| 44 |
+ |
|
| 45 |
+``` |
|
| 46 |
+$ docker service create --mode global --name backend backend:latest |
|
| 47 |
+b4g08uwuairexjub6ome6usqh |
|
| 48 |
+$ docker service scale backend=10 |
|
| 49 |
+backend: scale can only be used with replicated mode |
|
| 50 |
+``` |
|
| 51 |
+ |
|
| 43 | 52 |
Directly afterwards, run `docker service ls`, to see the actual number of |
| 44 | 53 |
replicas. |
| 45 | 54 |
|