0

I am installing MongoDB on Solus linux using the instructions here:

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/

I have Mongo DB in a folder named mongo on the desktop.

I used the following to "set the path variable" per the instructions ( I'm not sure if I did this correctly )

export PATH=Desktop/mongo/bin:$PATH

In the terminal I went to:

admin@solus ~ $ 

I then typed mongod

The result is the following error:

2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] MongoDB starting : pid=5052 port=27017 dbpath=/data/db 64-bit host=solus
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] db version v3.4.1
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] allocator: tcmalloc
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] modules: none
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] build environment:
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten]     distarch: x86_64
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten]     target_arch: x86_64
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] options: {}
2016-12-21T02:53:55.328-0800 I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2016-12-21T02:53:55.328-0800 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2016-12-21T02:53:55.328-0800 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] now exiting
2016-12-21T02:53:55.328-0800 I CONTROL  [initandlisten] shutting down with code:100

It says it can't find the data/db folder, but I've tried placing it in the mongo directory as well as the home directory.

William
  • 4,422
  • 17
  • 55
  • 108

1 Answers1

0

Try using the dbpath from the users home directory. I created /data/db in my home directory, so below is the command I use.

mongod --dbpath /home/user/data/db
amarnath
  • 785
  • 3
  • 19
  • 23
monx
  • 1