Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Adding a MongoDB cartridge to your application


In this recipe, you will learn how to add a MongoDB cartridge to your OpenShift application. MongoDB is a document-oriented, horizontally scalable, and NoSQL data store.

Getting ready

To step through this recipe, you will need the rhc command-line client installed on your machine. Refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift for details. Also, we will use the application created in the Creating an OpenShift application using the rhc command-line client recipe in Chapter 3, Creating and Managing Applications.

How to do it…

To install the MongoDB cartridge to the myapp application, use the following steps:

  1. Open a new command-line terminal, then change the directory to the myapp directory location and execute the following command:

    $ rhc cartridge-add c mongodb-2.4 --app myapp
    

    This will install a new instance of MongoDB on your application gear. The -c option is used to specify the...