Services can be uninstalled from the DC/OS™ CLI. If a Catalog service has any reserved resources that could not be cleaned up by the normal uninstall process, you may also need to run the framework cleaner script. The framework cleaner script removes the service instance from ZooKeeper™, along with any data associated with it.
Uninstalling Catalog services
CLI
Uninstall a datacenter service with this command:
For example, to uninstall Chronos:
Web interface
From the DC/OS web interface you can uninstall services from the Services tab. The Services tab provides a full-featured interface to the native DC/OS Marathon instance.
-
Navigate to the Services tab in the DC/OS web interface.
-
Select your service, click the vertical ellipsis at the far right, and select Delete.
Figure 1. Delete Services
-
Copy and run the displayed command.
Troubleshooting
It is possible for an uninstall to fail with the following error message:
The service may be inactive and will not be shown in the DC/OS UI, but you can find it by using this CLI command:
You can complete the uninstall by shutting down the service by using this CLI command with the service ID specified, and then run the framework cleaner:
Uninstalling user-created services
CLI
Uninstall a user-created service with this command:
For more information, see the command reference.
Web interface
You can uninstall services from the DC/OS web interface, from the Services tab. The Services tab provides a full-featured interface to the native DC/OS Marathon instance.
Services tab
- Navigate to the Services tab in the DC/OS web interface.
- Click on the Installed tab to see your installed services.
- Hover your cursor over the name of the package you wish to uninstall and you will see a red “Uninstall” link to the right. Click this link to uninstall the package.
Cleaning up Resources and ZooKeeper
About the cleanup
If your service has reserved resources and it did not completely clean itself up automatically, you can use the framework cleaner Docker® image, mesosphere/janitor
, to simplify the process of removing your service instance from ZooKeeper and destroying all the data associated with it. On DC/OS 1.10+ clusters, this should only be necessary in rare circumstances such as a failed uninstall. The package’s documentation may have its own additional information in an “Uninstall” section.
There are two ways to run the framework cleaner script. The preferred method is using the DC/OS CLI. If the CLI is unavailable, you can also run the image as a self-deleting Marathon task.
Configuring the cleanup
The script takes the following flags:
-r <role>
: The role of the resources to be deleted-z <zk-node>
: The configuration Zookeeper node to be deleted
The command would be run as follows:
If you are using a strict-mode cluster, you must provide additional arguments providing credentials to perform the cleanup:
-a <token>
: Token to be used for authentication--username <username>
and--password <password>
: Username and password to be used for authentication
For example, the command could be run with an auth token included as follows:
Running from the DC/OS CLI
Connect to the leader and start the script:
-
Open an SSH session to the cluster leader.
-
Run the
mesosphere/janitor
image with the role and zookeeper node that were configured for your service, along with an auth token if on a strict mode cluster:
Running from Marathon
From the DC/OS Services tab, use the JSON editor to add the following as a Marathon task. Replace the values passed to -r
/-z
according to what needs to be cleaned up.
When the framework cleaner has completed its work, it will automatically remove itself from Marathon to ensure that it’s only run once. This removal will often result in a TASK_KILLED
or even a TASK_FAILED
outcome for the janitor task, even if it finished successfully. The janitor task will also quickly disappear from both the Services and Dashboard tab.
Verifying the outcome
To view the script’s outcome, go to Mesos (http://your-cluster.com/mesos
) and look at the task’s stdout
content. If stdout
lacks content, run the following command manually:
Sample result
Here is an example of the output for a successful run for a sample installation:
If you run the script from Marathon, you will also see the following output: