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

Enabling the MongoDB cartridge REST interface


MongoDB exposes a minimal REST interface that allows users to query collections. The interface does not expose operations to insert, update, or remove documents. In this recipe, you will learn how to enable the MongoDB cartridge REST interface.

Getting ready

To complete this recipe, you will need an application with a MongoDB cartridge. Refer to the Adding a MongoDB cartridge to your application recipe in this chapter to learn how to add one.

How to do it…

Perform the following steps to enable the MongoDB REST interface:

  1. Open a new command-line terminal and SSH into the myapp application gear using the ssh command:

    $ rhc ssh --app myapp
    
  2. Once inside the application gear, change the directory to mongodb/conf and edit the mongodb.conf file using Vim.

  3. Now, we need to update the nohttpinterface property value to false so that MongoDB enables the HTTP frontend on the 28017 port. To enable the REST interface, you have to add a new property, rest, and set...