我正在使用此处的说明在 Solus linux 上安装 MongoDB:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/
mongo
我在桌面上命名的文件夹中有 Mongo DB 。
我按照说明使用以下内容“设置路径变量”(我不确定我是否正确执行此操作)
export PATH=Desktop/mongo/bin:$PATH
在终端我去了:
admin@solus ~ $
然后我输入mongod
结果是以下错误:
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
它说它找不到 data/db 文件夹,但我尝试将它放在 mongo 目录和主目录中。