unable to start mongod

1

Good afternoon, I'm following a course on mongoDB created by openclassrooms . However after installing it by link it was not able to use it with the commando mongodb . In effect it tells me that there is a ERROR: dbpath (/data/db) does not exist.

The complete output is:

:~/mongodb-linux-x86_64-ubuntu1604-3.4.3/bin$ mongod
mongod --help for help and startup options
2017-04-06T23:24:30.258+0200 [initandlisten] MongoDB starting : pid=23743 port=27017 dbpath=/data/db 64-bit host=antoine-Inspiron-3543
2017-04-06T23:24:30.258+0200 [initandlisten] db version v2.6.10
2017-04-06T23:24:30.258+0200 [initandlisten] git version: nogitversion
2017-04-06T23:24:30.258+0200 [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2017-04-06T23:24:30.258+0200 [initandlisten] build info: Linux lgw01-12 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 BOOST_LIB_VERSION=1_58
2017-04-06T23:24:30.258+0200 [initandlisten] allocator: tcmalloc
2017-04-06T23:24:30.258+0200 [initandlisten] options: {}
2017-04-06T23:24:30.258+0200 [initandlisten] exception in initAndListen: 10296 
*********************************************************************
 ERROR: dbpath (/data/db) does not exist.
 Create this directory or give existing directory in --dbpath.
 See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
2017-04-06T23:24:30.258+0200 [initandlisten] dbexit: 
2017-04-06T23:24:30.258+0200 [initandlisten] shutdown: going to close listening sockets...
2017-04-06T23:24:30.258+0200 [initandlisten] shutdown: going to flush diaglog...
2017-04-06T23:24:30.258+0200 [initandlisten] shutdown: going to close sockets...
2017-04-06T23:24:30.258+0200 [initandlisten] shutdown: waiting for fs preallocator...
2017-04-06T23:24:30.258+0200 [initandlisten] shutdown: lock for final commit...
2017-04-06T23:24:30.259+0200 [initandlisten] shutdown: final commit...
2017-04-06T23:24:30.259+0200 [initandlisten] shutdown: closing all files...
2017-04-06T23:24:30.259+0200 [initandlisten] closeAllFiles() finished
2017-04-06T23:24:30.259+0200 [initandlisten] dbexit: really exiting now
    
asked by ThePassenger 06.04.2017 в 23:27
source

1 answer

2

You have to create the directory that mongo is asking you to save the data with the following commands:

sudo mkdir -p / data / db /

sudo chown id -u / data / db

with the first one the directory that mongo needs is created and with the second one you make the user owner of the directory to be able to write on the

    
answered by 06.04.2017 / 23:34
source