Starting/stopping/restarting an application

The rhc command-line client provides commands to start, stop, and restart an application. In this recipe, you will learn how to perform these commands using rhc.

Getting ready

To step through this recipe, you will need rhc installed on your machine. Also, we will make use of the OpenShift application created in the Creating an OpenShift application using the rhc command-line client recipe.

How to do it…

To start an application, run the following command:

rhc start-app --app myapp

To stop an application, run the following command:

rhc stop-app --app myapp

To restart an application, run the following command:

rhc restart-app –-app myapp

The --app option is not required if you are running the command from within ...

Get OpenShift Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.