Mongod 没有启动
Mongod not starting
我无法在我的 ubuntu 机器上 运行 mongod。我阅读了一些博客和 Whosebug 线程,建议通过
更改 /var/lib/mongodb
和 /var/log/mongodb
文件夹的所有权
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown -R mongodb:mongodb /var/log/mongodb
但我仍然无法 运行 mongod 并收到以下错误消息。
vinayak@vinayak-Lenovo-G500:~$ mongod
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] MongoDB starting : pid=3211 port=27017 dbpath=/data/db 64-bit host=vinayak-Lenovo-G500
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] db version v3.2.3
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] allocator: tcmalloc
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] modules: none
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] build environment:
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] distmod: ubuntu1404
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] distarch: x86_64
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] target_arch: x86_64
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] options: {}
2016-03-04T09:31:29.968+0530 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2016-03-04T09:31:29.968+0530 E NETWORK [initandlisten] addr already in use
2016-03-04T09:31:29.968+0530 E STORAGE [initandlisten] Failed to set up sockets during startup.
2016-03-04T09:31:29.968+0530 I CONTROL [initandlisten] dbexit: rc: 48
vinayak@vinayak-Lenovo-G500:~$
..我不这么认为,我的 mongodb 已损坏,因为它是全新安装的,我没有在其中进行任何调整。
请提出任何解决方案。谢谢。
根据您的堆栈跟踪错误“地址已用于套接字:0.0.0.0:27017”
您可以在不同的端口上尝试 运行
例如
mongod --port 12345
Write following thing in the terminal and it would definitely work(it have worked for me in macbook).
sudo killall -15 mongod
我无法在我的 ubuntu 机器上 运行 mongod。我阅读了一些博客和 Whosebug 线程,建议通过
更改/var/lib/mongodb
和 /var/log/mongodb
文件夹的所有权
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown -R mongodb:mongodb /var/log/mongodb
但我仍然无法 运行 mongod 并收到以下错误消息。
vinayak@vinayak-Lenovo-G500:~$ mongod
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] MongoDB starting : pid=3211 port=27017 dbpath=/data/db 64-bit host=vinayak-Lenovo-G500
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] db version v3.2.3
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] allocator: tcmalloc
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] modules: none
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] build environment:
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] distmod: ubuntu1404
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] distarch: x86_64
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] target_arch: x86_64
2016-03-04T09:31:29.942+0530 I CONTROL [initandlisten] options: {}
2016-03-04T09:31:29.968+0530 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2016-03-04T09:31:29.968+0530 E NETWORK [initandlisten] addr already in use
2016-03-04T09:31:29.968+0530 E STORAGE [initandlisten] Failed to set up sockets during startup.
2016-03-04T09:31:29.968+0530 I CONTROL [initandlisten] dbexit: rc: 48
vinayak@vinayak-Lenovo-G500:~$
..我不这么认为,我的 mongodb 已损坏,因为它是全新安装的,我没有在其中进行任何调整。
请提出任何解决方案。谢谢。
根据您的堆栈跟踪错误“地址已用于套接字:0.0.0.0:27017” 您可以在不同的端口上尝试 运行 例如 mongod --port 12345
Write following thing in the terminal and it would definitely work(it have worked for me in macbook).
sudo killall -15 mongod