Learn DC/OS with minidcos (3) – Install and Use DC/OS CLI

After Part I and Part II, you have a workable DC/OS cluster and a nginx service is running. In this chapter, let’s talk about how to use DC/OS CLI, which is a helpful tool.

Installation

The DC/OS CLI’s version need to be the same as the DC/OS cluster runs. With minidcos, I installed the 1.12.5 so CLI’s version needs to be 1.12 as well. Use the following commands to download the CLI binary.

Then setup it

The DC/OS page will be open and log into to get the token. When token is typed in, your CLI is already attached to the running cluster. It’s ready to use it.

Commands

DC/OS CLI provides a lot of useful commands. With it, you can do the same as the GUI does. Here are some examples.

For more details, please use argument “-h” to check.

Let’s use CLI to run a service. I extracted the Nginx service configuration into the JSON file and the id was changed to “/nginx-service2”.

Then use “dcos marathon app add” to create a new service “/nginx-service2

From GUI, you can see the similar status.

All right. Now you know how to install CLI and some basic commands to check the status of cluster/node/services.

References