I created an Ubuntu container on Nitrous.io so that I can develop on my chromebook without the chromebook's limitation. I am having trouble using mongodb. I followed these steps to install it:
~ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
~ echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
~ sudo apt-get update
~ sudo apt-get install -y mongodb-org
~ sudo service mongod start
I can't connect to mongo through the mongo shell. I get this error message:
MongoDB shell version: 3.0.6
connecting to: test
2015-10-02T21:13:56.629+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-10-02T21:13:56.630+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
I have tried deleting the lock file and creating a 'data' directory and then setting the dbpath to that directory:
~ sudo rm /var/lib/mongodb/mongod.lock
~ sudo service mongodb restart
and
~ mkdir data
~ cd data
~ mongod --dbpath .
The Ubuntu container is 64 bit 14.04 I believe Nitrous uses Docker containers if that makes a difference. I don't think I have direct root access, but I have sudo access which doesn't require a password. More generally, has anyone else had a lot of problems installing Mongo? I can never seem to get it to just install smoothly.