安装MongoDB时出错

时间:2016-08-02 22:39:23

标签: mongodb installation

我通过自制软件安装mongodb后,当我输入mongod时收到以下消息:

kamflamenco ~ $ mongod
2016-08-02T15:34:39.934-0700 I CONTROL  [initandlisten] MongoDB starting : pid=4167 port=27017 dbpath=/data/db 64-bit host=Kenzos-MacBook-Pro.local
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] db version v3.2.8
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] git version: ed70e33130c977bda0024c125b56d159573dbaf0
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2h  3 May 2016
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] allocator: system
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] modules: none
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] build environment:
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten]     distarch: x86_64
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten]     target_arch: x86_64
2016-08-02T15:34:39.935-0700 I CONTROL  [initandlisten] options: {}
2016-08-02T15:34:39.936-0700 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-08-02T15:34:39.938-0700 I STORAGE  [initandlisten] exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
2016-08-02T15:34:39.938-0700 I CONTROL  [initandlisten] dbexit:  rc: 100

我是新手,我已经尝试过研究这个错误。但是,我没有运气,包括输入

sudo chmod 777

mongod唯一有效的时间是我在它前面键入sudo

sudo mongod

但我觉得这不对......

1 个答案:

答案 0 :(得分:1)

删除mongod.lock文件:

sudo rm /data/db/mongod.lock