'的mongod'尽管创建了/ data / db文件但仍未运行

时间:2017-12-26 16:13:15

标签: javascript database mongodb

我创建了一个/ data / db文件,这曾经有用,我不知道发生了什么变化,但是当我尝试创建一个新的Schema并使用compression-input进行测试时,我收到了以下错误:< / p>

mongod

使用命令2017-12-26T11:08:35.428-0500 I CONTROL [initandlisten] MongoDB starting : pid=41342 port=27017 dbpath=/data/db 64-bit host=Carloss-MBP.home 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] db version v3.4.10 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] git version: 078f28920cb24de0dd479b5ea6c66c644f6326e9 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2m 2 Nov 2017 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] allocator: system 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] modules: none 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] build environment: 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] distarch: x86_64 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] target_arch: x86_64 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] options: {} 2017-12-26T11:08:35.429-0500 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to lock file: /data/db/mongod.lock Resource temporarily unavailable. Is a mongod instance already running?, terminating 2017-12-26T11:08:35.429-0500 I NETWORK [initandlisten] shutdown: going to close listening sockets... 2017-12-26T11:08:35.429-0500 I NETWORK [initandlisten] shutdown: going to flush diaglog... 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] now exiting 2017-12-26T11:08:35.429-0500 I CONTROL [initandlisten] shutting down with code:100 可以正常运行mongo服务器,是否还必须手动创建mongo文件?不确定这里发生了什么......

1 个答案:

答案 0 :(得分:0)

看起来你已经有一个mongod进程正在运行。使用'ps'命令检查并在必要时终止。它可能会锁定你的/ data / db目录。这个命令应该适合你

  

mongod --shutdown