Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for username and password #1

Closed
VictorBargains opened this issue Feb 13, 2015 · 6 comments
Closed

Support for username and password #1

VictorBargains opened this issue Feb 13, 2015 · 6 comments

Comments

@VictorBargains
Copy link

Hi. I am very new to OpenShift and was getting errors in their mongodb-2.4 cartridge so I am trying your 2.6 cartridge. It fixed my site so now it works. Thanks!

But, the default OpenShift mongodb cartridge sets itself up with a username and password by default which are populated in environment variables.

Is there a way to get a username and password on the database, and have it set up by default?

Or is a password unnecessary because of how OpenShift sandboxes gears?

@icflorescu
Copy link
Owner

Hi, Victor! I'm glad you find this cartridge useful!

Most people would use this cartridge for simple, non-critical projects in a free gear, and the free gears aren't accepting external connections anyway (except through rhc port-forward from an authenticated machine), so - to keep things simple - I'd say there's no real need for username/password.

Basically the only things that can connect to the MongoDB instance are:

  • your web application residing in the main gear (or in the same gear if you're not using scaling);
  • your development machine.

@icflorescu
Copy link
Owner

If you're thinking about a large / critical project, I'd suggest using a specialized MongoDB provider like MongoLab or Compose, and keep in mind that OpenShift will switch to a Docker-based architecture in a few months.

@VictorBargains
Copy link
Author

Thanks for the tip. I am currently just evaluating the platform. I don't
even know what Docker is so I guess I have my research cut out for me.

One more thing -- from my rhc ssh shell I can't use the mongo command
(bash: mongo: command not found), whereas I seem to recall that working
using the default mongodb cartridge. Is there just a configuration issue I
need to address?

On Fri, Feb 13, 2015 at 10:26 AM, Ionut-Cristian Florescu <
[email protected]> wrote:

If you're thinking about a large / critical project, I'd suggest using a
specialized MongoDB provider like MongoLab https://mongolab.com/ or
Compose https://www.compose.io/mongodb/, and keep in mind that
OpenShift will switch to a Docker-based architecture in a few months.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@icflorescu
Copy link
Owner

A full MongoDB installation would take up lots of space, over 250 MB last time I checked, and if you're using a standard OpenShift cartridge this could become a problem. That's why I'm only keeping mongod in the cartridge - the bare minimum to run the server; that way you can use the entire cartridge storage space for your data (~1GB on the standard cartridge, I think).

To directly connect to the server MongoDB instance you'll have to use rhc port-forward (see more here), and then you can use mongo, RoboMongo or any MongoDB client as you would for a server running locally on your development machine. Just make sure to specify the forwarded port when you're connecting.

@icflorescu
Copy link
Owner

A quick notice for people using rhc port-forward to connect from their development machines: for now, MongoChef offers better support for MongoDB 3.x than RoboMongo.

@burgalon
Copy link

@icflorescu What do you think about this tutorial for sharing a database across apps/gears:
https://blog.openshift.com/sharing-database-across-applications/

It seems like there is a way to connect to ports other than 80/8080 however I'm not seeing any mention of this in the cartridge building documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants