在终端中启动mongodb时出错

时间:2015-01-05 17:55:07

标签: mongodb

运行“mongod”时,我得到以下内容:

mongod --help for help and startup options
2015-01-05T09:48:03.865-0800 [initandlisten] MongoDB starting : pid=1404 port=27017 dbpath=/data/db 64-bit host=Rahuls-MacBook-Pro.local
2015-01-05T09:48:03.865-0800 [initandlisten] db version v2.6.6
2015-01-05T09:48:03.865-0800 [initandlisten] git version: nogitversion
2015-01-05T09:48:03.865-0800 [initandlisten] build info: Darwin miniyosemite.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-01-05T09:48:03.865-0800 [initandlisten] allocator: tcmalloc
2015-01-05T09:48:03.865-0800 [initandlisten] options: {}
2015-01-05T09:48:03.865-0800 [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
2015-01-05T09:48:03.865-0800 [initandlisten] dbexit: 
2015-01-05T09:48:03.865-0800 [initandlisten] shutdown: going to close listening sockets...
2015-01-05T09:48:03.865-0800 [initandlisten] shutdown: going to flush diaglog...
2015-01-05T09:48:03.865-0800 [initandlisten] shutdown: going to close sockets...
2015-01-05T09:48:03.865-0800 [initandlisten] shutdown: waiting for fs preallocator...
2015-01-05T09:48:03.865-0800 [initandlisten] shutdown: lock for final commit...
2015-01-05T09:48:03.866-0800 [initandlisten] shutdown: final commit...
2015-01-05T09:48:03.866-0800 [initandlisten] shutdown: closing all files...
2015-01-05T09:48:03.866-0800 [initandlisten] closeAllFiles() finished
2015-01-05T09:48:03.866-0800 [initandlisten] dbexit: really exiting now

我知道这是一个路径错误但是如何设置路径以便服务器启动?

0 个答案:

没有答案