MongoDB not waiting for connections on port 28017

database connectionmongodbport

I just started with MongoDB on Windows 7. I can connect to port 27017, but I'm not getting the "admin web console waiting for connections on port 28017" message, so when I visit http://localhost:28017/, nothing appears.

I get the following messages in the console:

2015-06-02T17:54:43.271-0700 I CONTROL  Hotfix KB2731284 or later update is installed, no need to zero-out data files

2015-06-02T17:54:43.281-0700 I JOURNAL  [initandlisten] journal dir=C:\data\db\journal

2015-06-02T17:54:43.282-0700 I JOURNAL  [initandlisten] recover : no journal files present, no recovery needed

2015-06-02T17:54:43.307-0700 I JOURNAL  [durability] Durability thread started

2015-06-02T17:54:43.308-0700 I JOURNAL  [journal writer] Journal writer thread started

2015-06-02T17:54:43.423-0700 I CONTROL  [initandlisten] MongoDB starting : pid=5452 port=27017 dbpath=C:\data\db\ 64-bit host=myName-PC

2015-06-02T17:54:43.423-0700 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2

2015-06-02T17:54:43.424-0700 I CONTROL  [initandlisten] db version v3.0.3

2015-06-02T17:54:43.428-0700 I CONTROL  [initandlisten] git version: b40106b36eecd1b4407eb1ad1af6bc60593c6105

2015-06-02T17:54:43.430-0700 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1m-fips 19 Mar 2015


2015-06-02T17:54:43.432-0700 I CONTROL  [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49


2015-06-02T17:54:43.434-0700 I CONTROL  [initandlisten] allocator: system

2015-06-02T17:54:43.435-0700 I CONTROL  [initandlisten] options: { net: { port: 27017 } }

2015-06-02T17:54:43.461-0700 I NETWORK  [initandlisten] waiting for connections on port 27017

Any help would be appreciated!

My mongod.cfg file looks like this:

logpath=c:\data\log\mongod.log
dbpath=c:\data\db

Best Answer

If you want to use your mongod.cfg file for controlling your port use the following:

# set the port number below
port = 8080
dbpath = c:/data/db
logpath = c:/data/log/mongod.log
logappend = yes

Please note though that the port you assign needs to be accessible and not in use or blocked by your firewall

Also make sure that if you are running this as a Windows Service that you need to stop it. Most probably with:

net stop MongoDB

then make the change to the file and restart the service

net start MongoDB