Git Product home page Git Product logo

openshift-cartridge-mongodb's Introduction

Custom MongoDB cartridge for OpenShift

This is a custom OpenShift cartridge providing MongoDB > 3.0.3.

Why

Because the standard OpenShift MongoDB cartridge is stuck at 2.4.

When to use

When you need a quick and unsofisticated solution to run your application with the latest MongoDB version.

How to

To install this cartridge in your existing OpenShift application, go to "See the list of cartridges you can add", paste the URL below in "Install your own cartridge" textbox at the bottom of the page and click "Next".

http://cartreflect-claytondev.rhcloud.com/github/icflorescu/openshift-cartridge-mongodb

Then you can use MONGODB_URL environment variable to connect from an application running in the main web cartridge.

To keep things flexible, the connection string stored in MONGODB_URL ends with / and does not include a database name. Use your application logic to name/create your database(s) as needed.

For instance, here's how you'd do it in a Node.js application using Mongoose ODM:

var mongoose = require('mongoose');
...
// Mongoose will create database_name if necessary
mongoose.connect(process.env.MONGODB_URL + 'database_name', { db: { nativeParser: true } });

Notes

  • Can't guarantee this cartridge is production-ready. Some people use it though (on their own responsibility).
  • This is a lean cartridge. To save space, just mongod is installed. No client libraries, no mongo console. If you need external access to your data, use rhc port-forward.
  • By default, the underlying MongoDB instance will accept unauthenticated access, which should be fine for most typical usage scenarios. See the discussion here for more info.
  • Can't think of a way to make this cartridge auto-updatable. There's nothing like semver.io for MongoDB. For now we'll just have to use mongodump, destroy the cartridge, install the new version, then do a mongorestore.
  • Don't hesitate to make a pull-request with an updated version in this file if you notice this cartridge version is behind the latest stable official MongoDB linux binary.

FAQ

Q: I'm getting the error Cannot download, must be smaller than 20480 bytes while trying to deploy the cartridge to OpenShift. What am I doing wrong?

A: You're probably trying to use the URL https://github.com/icflorescu/openshift-cartridge-mongodb instead of http://cartreflect-claytondev.rhcloud.com/github/icflorescu/openshift-cartridge-mongodb. A common mistake for people not paying sufficient attention while trying to use a custom cartridge for the first time.

Related

Since you're here, chances are you might also be interested in this custom Node.js cartridge.

License

The MIT License.

openshift-cartridge-mongodb's People

Contributors

icflorescu avatar baskerville avatar

Watchers

James Cloos avatar Rado avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.