1

Able to run MongoDB locally but when trying to access remotely it failed. Havent done any firewall setup. What could be the issue? How to do troubleshoot?

Also the MongoDB status show running

service mongod status
mongod (pid 25342) is running...

But when trying to restart the service it says

service mongod restart
Stopping mongod:                                           [  OK  ]
Starting mongod:                                           [FAILED]

But still the process is running

Update

Tried mongod --repair here is the update

2015-01-10T10:46:33.109-0500 [initandlisten] MongoDB starting : pid=29018 port=2                                                                                        7017 dbpath=/data/db 64-bit host=ns4008927.ip-192-99-3.net
2015-01-10T10:46:33.109-0500 [initandlisten] db version v2.6.6
2015-01-10T10:46:33.109-0500 [initandlisten] git version: 608e8bc319627693b04cc7                                                                                        da29ecc300a5f45a1f
2015-01-10T10:46:33.109-0500 [initandlisten] build info: Linux build10.nj1.10gen                                                                                        .cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LI                                                                                        B_VERSION=1_49
2015-01-10T10:46:33.109-0500 [initandlisten] allocator: tcmalloc
2015-01-10T10:46:33.109-0500 [initandlisten] options: { repair: true }
2015-01-10T10:46:33.112-0500 [initandlisten] finished checking dbs
2015-01-10T10:46:33.112-0500 [initandlisten] dbexit:
2015-01-10T10:46:33.112-0500 [initandlisten] shutdown: going to close listening                                                                                         sockets...
2015-01-10T10:46:33.112-0500 [initandlisten] shutdown: going to flush diaglog...
2015-01-10T10:46:33.112-0500 [initandlisten] shutdown: going to close sockets...
2015-01-10T10:46:33.112-0500 [initandlisten] shutdown: waiting for fs preallocat                                                                                        or...
2015-01-10T10:46:33.112-0500 [initandlisten] shutdown: closing all files...
2015-01-10T10:46:33.112-0500 [initandlisten] closeAllFiles() finished
2015-01-10T10:46:33.112-0500 [initandlisten] shutdown: removing fs lock...
2015-01-10T10:46:33.112-0500 [initandlisten] dbexit: really exiting now
Rajandran R
  • 223
  • 1
  • 3
  • 13
  • didn't ````mongodb --repair```` work? http://stackoverflow.com/questions/9884233/mongodb-service-is-not-starting-up – Erik van de Ven Jan 10 '15 at 15:33
  • What language/tool are you using to access the dB? What kind of error is it giving? – ZacWolf Jan 10 '15 at 15:33
  • @ErikVandeVen : Nope try it out it doesnt solves the problem – Rajandran R Jan 10 '15 at 15:39
  • @ZacWolf : using PHP also try to access remotely using MongoVue both are showing that remove server refused connection – Rajandran R Jan 10 '15 at 15:43
  • It looks like you might have two problems? Can you show how you connect locally and how you try to connect remotely? That problem wouldn't necessarily be related to the service restart not working as expected, especially since we see the mongod running. – wdberkeley Jan 11 '15 at 02:18

1 Answers1

1

You need to remove this line from mongo's config file (on Ubuntu, mine is at /etc/mongod.conf):

bind_ip = 127.0.0.1

Or, if it's YAML,

bindIp: 127.0.0.1

Source: http://docs.mongodb.org/manual/reference/configuration-options/

"Changed in version 2.6.0: The deb and rpm packages include a default configuration file that sets net.bindIp to 127.0.0.1."

The default value for bindIp/bind_ip is "all interfaces" - so that's where the deletion comes in handy.

Mark Dickson Jr.
  • 588
  • 4
  • 10