Can I install mongodb separately without installing nodejs?
zhouhao27 opened this issue · 1 comments
I'm wondering if it's possible to only install a mongodb in a gear? Or if not, can I minimize the size of nodejs because the storage will take more than 400MB after I install mongodb and nodejs.
Sure. It may not be explicit in the OpenShift docs, but if you create a scalable main web application, additional cartridges will be installed in separate gears:
I think you can also do this from the command line by running something like:
rhc app create appname -s \
https://raw.githubusercontent.com/icflorescu/openshift-cartridge-nodejs/master/metadata/manifest.yml \
https://raw.githubusercontent.com/icflorescu/openshift-cartridge-mongodb/master/metadata/manifest.yml
Note the -s
/--scaling
option for rhc
that allows you to do just that – create a scalable application.
Then you can connect from your web application running in the main application gear using OPENSHIFT_MONGODB_DB_HOST
/OPENSHIFT_MONGODB_DB_PORT
or just MONGODB_URL
.
As a side note, there would be enough space for your data even if would you install it in the same gear with Node.js. As far as I remember, the Node.js-related stuff is only a few megabytes.
Gaining storage space is the reason why – in this cartridge install script I'm only keeping the mongod
binary and discarding everything else in the MongoDB distribution.
Feel free to refer to the readme FAQ list for any other questions (and even to contribute to that list ;-).