简体   繁体   中英

Mongod not starting

I cannot run mongod in my ubuntu machine. I read some blogs and stackoverflow threads suggesting to change the ownership of the /var/lib/mongodb and /var/log/mongodb folders by,

sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown -R mongodb:mongodb /var/log/mongodb

but I still cant run mongod and getting the following error message.

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:~$ 

..and I don't think so, my mongodb is corrupted as it is fresh install and I haven't tweaked anything in it.

Please suggest any solution. Thank you.

通过堆栈跟踪错误“套接字已使用地址:0.0.0.0:27017”,您可以尝试在其他端口上运行,例如mongod --port 12345

在终端中编写以下内容,它肯定可以工作(在macbook中对我有用)。

sudo killall -15 mongod

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM