linuxmongodbunixcrouton-os

MongoDB - Xubuntu crouton - can't start service


I've tried following the installation instructions laid out here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

But I run into a problem with, I'm guessing, Upstart/initctl and I can't get the mongod service to start other than by running it manually as sudo in a terminal, which is a Bad Idea IMO. (Even if this is merely for a classroom, single-user setup.)

sudo /etc/init.d/mongod start

Yields this error:

initctl: Unknown job: mongod

I've tried sudo initctl reload-configuration and running the above start command again, to no avail.

Any ideas or suggestions on what to do next?


Solution

  • Installing mongodb using what the official documentation doesn't seem to work in crouton. Below are the instructions I followed to get it working on my machine (crouton running elementaryOS)

    1. Download the physical mongodb package for linux (can be obtained from mongodb.org)
    2. Extract the mongodb package using tar -xvzf mongodb-linux-x86_64-2.6.7.tgz
    3. Make the installation directory (sudo mkdir /usr/lib/mongodb)
    4. Copy the extracted mongodb into to /usr/lib/mongodb (sudo mv mongodb-linux-x86_64-2.6.7 /usr/lib/mongodb)
    5. Make the data directory (sudo mkdir -p /data/db)
    6. Start mongodb (sudo /usr/lib/mongodb/mongodb-linux-x84_64-2.6.7/bin/mongod &)