Scaling a Service

Scaling a service using the UI and the CLI

This tutorial shows how to scale a service using the UI and the CLI.

Scale Your Service from the UI

  1. From the Services tab, click the menu dots to the right side of your service to access More Actions.

    Menu

    Figure 1. More Actions menu

  2. From the drop-down menu, select Scale.

    more actions menu

    Figure 2. More Actions menu

  3. In the Scale Service box, enter the total number of instances you would like, then click Scale Service.

    scale

    Figure 3. Choose number of instances

  4. From the Services tab, you can see your service scaling.

    service deploying

    Figure 4. Service scaling

  5. Click the name of your service to see your scaled service. post scale

    Figure 5. Services list

Scale Your Service from the CLI

You will need your app-id for this procedure.

  1. Enter the following command from the CLI, replacing app-id with your own value and total_desired_instances with your own number:

    dcos marathon app update <app-id> instances=<total_desired_instances>
    
  2. Enter this command to see your scaled service.

    dcos task <task-id>
    

For example, this task is scaled to 6 instances:

dcos marathon app update basic-0 instances=6
dcos task basic-0
NAME     HOST        USER  STATE  ID                                            
basic-0  10.0.0.10   root    R    basic-0.1c73e448-0b47-11e7-a8b6-de4438bbb8f0  
basic-0  10.0.1.101  root    R    basic-0.1c739626-0b47-11e7-a8b6-de4438bbb8f0  
basic-0  10.0.1.41   root    R    basic-0.1c736f14-0b47-11e7-a8b6-de4438bbb8f0  
basic-0  10.0.1.92   root    R    basic-0.12d5bbc2-0b47-11e7-a8b6-de4438bbb8f0  
basic-0  10.0.1.92   root    R    basic-0.1c73bd37-0b47-11e7-a8b6-de4438bbb8f0  
basic-0  10.0.3.180  root    R    basic-0.1c739625-0b47-11e7-a8b6-de4438bbb8f0