Why won't my mongodb connect to port 28017?

2019-09-21 12:00发布

问题:

I was hoping somone could help me with my problem with mongodb. I had been able to connect just fine before, however after my laptop's battery ran out during a power outage I have not been able to connect to port 28017 again. I repaired the database, yet when I connect it won't connect nor throw an error.

Console:

Fri Jul 19 22:19:01.175 [initandlisten] build info: Linux bs-linux32.10gen.cc 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_49
Fri Jul 19 22:19:01.175 [initandlisten] allocator: system
Fri Jul 19 22:19:01.175 [initandlisten] options: { dbpath: "/var/lib/mongodb" }
Fri Jul 19 22:19:01.363 [initandlisten] waiting for connections on port 27017
Fri Jul 19 22:19:01.363 [websvr] admin web console waiting for connections on port 28017

回答1:

So the solution turned out to be connecting on different ports than the default 27017 and 38017. I believe this is because of an unsafe shutdown I had, as I mentioned earlier.