0

Can someone lend me a hand with a first time user's install issues?

Any help would be greatly appreciated, I am running this off of Virtualbox.

1) I run 'mongod' and I get the following:

ERROR: dbpath (/data/db) does not exist. Create this directory or give existing directory in --dbpath. , terminating

2) Where do I go to set this? I look into /etc/mongod.conf and see the following line: (how should I change this?)

dbpath=/var/lib/mongodb

3) When I attempt to run 'mongo' I get the following:

2015-01-19T01:02:38.625-0700 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

2015-01-19T01:02:38.625-0700 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146

exception: connect failed

4) Also, I am not running on 127.0.0.1 so do I also change/set this from the mongod.conf file or set this elsewhere?

Kincsem
  • 127
  • 2
  • 11

1 Answers1

0

Did you try this answer ?

another thing that could help is to run mongod with the --dbpath parameter:

mongod --dbpath /var/lib/mongodb

But first make sure that this is your db directory.

Community
  • 1
  • 1
  • How do put this in my db directory? Can you step me through it? I run the command (you suggested) and get this `Unable to create/open lock file: /var/lib/mongodb/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating` my permissions on the mongod.lock are `rwx-xr-x` – Kincsem Jan 19 '15 at 08:19
  • One solution might be to run the command with sudo rights. but be aware: this can cause a problem, where you can only start it with sudo rights afterwards. Therfore it will never start at boot. You can also try this http://stackoverflow.com/a/15982017/3664966 more sophisticated but maybe better solution. – user3664966 Jan 19 '15 at 08:28
  • Question, where do I make /data/db at? The root or some other folder? – Kincsem Jan 19 '15 at 08:41
  • Wherever you want to have your db location – user3664966 Jan 19 '15 at 09:06
  • I see, do you have any idea where I can change the IP for questions 3 and 4? – Kincsem Jan 19 '15 at 09:31
  • Try this: http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption--bind_ip hope it helps – user3664966 Jan 19 '15 at 09:52