mongod shell doesn't start, data/db doesn't exsist - mongodb

When I start mongod trowed error. What is the problem?
root#cs12867:~# mongod
mongod --help for help and startup options
Sun Dec 22 15:37:44.081 [initandlisten] MongoDB starting : pid=18415 port=27017 dbpath=/data/db/ 64-bit host=cs12867
Sun Dec 22 15:37:44.081 [initandlisten] db version v2.4.6
Sun Dec 22 15:37:44.081 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Sun Dec 22 15:37:44.081 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Sun Dec 22 15:37:44.081 [initandlisten] allocator: tcmalloc
Sun Dec 22 15:37:44.081 [initandlisten] options: {}
Sun Dec 22 15:37:44.081 [initandlisten] exception in initAndListen: 10296
*********************************************************************
ERROR: dbpath (/data/db/) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
Sun Dec 22 15:37:44.081 dbexit:
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: going to close listening sockets...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: going to flush diaglog...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: going to close sockets...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: waiting for fs preallocator...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: lock for final commit...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: final commit...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: closing all files...
Sun Dec 22 15:37:44.081 [initandlisten] closeAllFiles() finished
Sun Dec 22 15:37:44.081 dbexit: really exiting now
I set --dbpath:
root#cs12867:~# mongod --dbpath /var/lib/mongodb/data/db
Sun Dec 22 15:29:25.121 [initandlisten] MongoDB starting : pid=17739 port=27017 dbpath=/var/lib/mongodb/data/db 64-bit host=cs12867
Sun Dec 22 15:29:25.121 [initandlisten] db version v2.4.6
Sun Dec 22 15:29:25.121 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Sun Dec 22 15:29:25.121 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Sun Dec 22 15:29:25.121 [initandlisten] allocator: tcmalloc
Sun Dec 22 15:29:25.121 [initandlisten] options: { dbpath: "/var/lib/mongodb/data/db" }
Sun Dec 22 15:29:25.121 [initandlisten]
Sun Dec 22 15:29:25.121 [initandlisten] ** WARNING: Readahead for /var/lib/mongodb/data/db is set to 2048KB
Sun Dec 22 15:29:25.121 [initandlisten] ** We suggest setting it to 256KB (512 sectors) or less
Sun Dec 22 15:29:25.121 [initandlisten] ** http://dochub.mongodb.org/core/readahead
Sun Dec 22 15:29:25.123 [initandlisten] journal dir=/var/lib/mongodb/data/db/journal
Sun Dec 22 15:29:25.123 [initandlisten] recover : no journal files present, no recovery needed
Sun Dec 22 15:29:25.134 [initandlisten] waiting for connections on port 27017
Sun Dec 22 15:29:25.134 [websvr] admin web console waiting for connections on port 28017
Sun Dec 22 15:29:26.179 [initandlisten] connection accepted from 127.0.0.1:37164 #1 (1 connection now open)
Sun Dec 22 15:29:26.179 [FileAllocator] allocating new datafile /var/lib/mongodb/data/db/Tester.ns, filling with zeroes...
Sun Dec 22 15:29:26.179 [FileAllocator] creating directory /var/lib/mongodb/data/db/_tmp
Sun Dec 22 15:29:26.181 [FileAllocator] done allocating datafile /var/lib/mongodb/data/db/Tester.ns, size: 16MB, took 0 secs
Sun Dec 22 15:29:26.181 [FileAllocator] allocating new datafile /var/lib/mongodb/data/db/Tester.0, filling with zeroes...
Sun Dec 22 15:29:26.181 [FileAllocator] done allocating datafile /var/lib/mongodb/data/db/Tester.0, size: 64MB, took 0 secs
Sun Dec 22 15:29:26.182 [FileAllocator] allocating new datafile /var/lib/mongodb/data/db/Tester.1, filling with zeroes...
Sun Dec 22 15:29:26.182 [FileAllocator] done allocating datafile /var/lib/mongodb/data/db/Tester.1, size: 128MB, took 0 secs
Sun Dec 22 15:29:26.184 [conn1] build index Tester.user { _id: 1 }
Sun Dec 22 15:29:26.184 [conn1] build index done. scanned 0 total records. 0 secs
Sun Dec 22 15:29:26.184 [conn1] end connection 127.0.0.1:37164 (0 connections now open)
Sun Dec 22 15:29:26.192 [initandlisten] connection accepted from 127.0.0.1:37165 #2 (1 connection now open)
Sun Dec 22 15:29:26.732 [initandlisten] connection accepted from 127.0.0.1:37166 #3 (2 connections now open)
Sun Dec 22 15:29:26.733 [conn3] end connection 127.0.0.1:37166 (1 connection now open)
Sun Dec 22 15:29:26.740 [initandlisten] connection accepted from 127.0.0.1:37167 #4 (2 connections now open)
Sun Dec 22 15:29:26.740 [conn4] end connection 127.0.0.1:37167 (1 connection now open)
Sun Dec 22 15:29:26.834 [initandlisten] connection accepted from 127.0.0.1:37168 #5 (2 connections now open)
Sun Dec 22 15:29:26.835 [conn5] end connection 127.0.0.1:37168 (1 connection now open)
Sun Dec 22 15:29:26.843 [initandlisten] connection accepted from 127.0.0.1:37169 #6 (2 connections now open)
Sun Dec 22 15:29:27.252 [initandlisten] connection accepted from 127.0.0.1:37170 #7 (3 connections now open)
Sun Dec 22 15:29:27.253 [conn7] end connection 127.0.0.1:37170 (2 connections now open)
Sun Dec 22 15:29:27.304 [initandlisten] connection accepted from 127.0.0.1:37171 #8 (3 connections now open)
Sun Dec 22 15:29:27.304 [conn8] end connection 127.0.0.1:37171 (2 connections now open)
Sun Dec 22 15:29:28.332 [initandlisten] connection accepted from 127.0.0.1:37173 #9 (3 connections now open)
Sun Dec 22 15:29:28.333 [conn9] end connection 127.0.0.1:37173 (2 connections now open)
Sun Dec 22 15:29:28.352 [initandlisten] connection accepted from 127.0.0.1:37174 #10 (3 connections now open)
Sun Dec 22 15:29:28.842 [conn10] end connection 127.0.0.1:37174 (2 connections now open)
Sun Dec 22 15:29:28.862 [initandlisten] connection accepted from 127.0.0.1:37176 #11 (3 connections now open)
Sun Dec 22 15:29:28.863 [conn11] end connection 127.0.0.1:37176 (2 connections now open)
Sun Dec 22 15:29:30.362 [initandlisten] connection accepted from 127.0.0.1:37178 #12 (3 connections now open)
Sun Dec 22 15:29:30.363 [initandlisten] connection accepted from 127.0.0.1:37179 #13 (4 connections now open)
Sun Dec 22 15:29:30.364 [conn13] end connection 127.0.0.1:37179 (3 connections now open)
Sun Dec 22 15:37:36.523 [signalProcessingThread] shutdown: closing all files...
Sun Dec 22 15:37:36.523 [signalProcessingThread] closeAllFiles() finished
Sun Dec 22 15:37:36.523 [signalProcessingThread] journalCleanup...
Sun Dec 22 15:37:36.523 [signalProcessingThread] removeJournalFiles
Sun Dec 22 15:37:36.525 [signalProcessingThread] shutdown: removing fs lock...
Sun Dec 22 15:37:36.525 dbexit: really exiting now
Then again:
root#cs12867:~# mongod
mongod --help for help and startup options
Sun Dec 22 15:37:44.081 [initandlisten] MongoDB starting : pid=18415 port=27017 dbpath=/data/db/ 64-bit host=cs12867
Sun Dec 22 15:37:44.081 [initandlisten] db version v2.4.6
Sun Dec 22 15:37:44.081 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Sun Dec 22 15:37:44.081 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Sun Dec 22 15:37:44.081 [initandlisten] allocator: tcmalloc
Sun Dec 22 15:37:44.081 [initandlisten] options: {}
Sun Dec 22 15:37:44.081 [initandlisten] exception in initAndListen: 10296
*********************************************************************
ERROR: dbpath (/data/db/) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
Sun Dec 22 15:37:44.081 dbexit:
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: going to close listening sockets...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: going to flush diaglog...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: going to close sockets...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: waiting for fs preallocator...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: lock for final commit...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: final commit...
Sun Dec 22 15:37:44.081 [initandlisten] shutdown: closing all files...
Sun Dec 22 15:37:44.081 [initandlisten] closeAllFiles() finished
Sun Dec 22 15:37:44.081 dbexit: really exiting now

The default db path for mongodb is /data/db/.
So when you run:
mongod
MongoDB checks if /data/db/ is present and if the user has access to it. In your case, there is no such directory and hence the error.
However you can override the default db path using the --dbpath argument of mongod( or use a config file).
mongod --dbpath /var/lib/mongodb/data/db
In this case instead of checking for /data/db/ mongoDB check for /var/lib/mongodb/data/db. In your case, you have the specified directory and you have access to it and hence it runs.
And doing this doesn't start the mongo shell. To start the shell, start mongod first as mentioned above and leave it running. Then in another terminal execute
mongo
This will start the mongo shell.

As I see from the problem that creating the data/db directory will fix your problem.
Create that and then add like this if you have directory path in c drive.
mongod --dbpath "c://data/db"
After setting the dbpath you should start the mongodb as service.
sudo service mongodb start

Another solution to that problem could be:
.
Delete the files inside of /data/journal/ or /data/db/journal/
.
Especially if your database stopped working after an unclean restart / crash. It seems that the journal files can get corrupted and block the mongo service from starting.
Remember to backup the files first just in case.
Following these posts:
https://stackoverflow.com/a/16323101
https://jira.mongodb.org/browse/SERVER-5380

Related

Mongo not starting on Ubuntu

I installed mongo on ubuntu using the instructions on the following page:
https://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
deploy#stockgame-with-login:~$ mongod --dbpath ~/data/db
Sun Jan 10 15:16:22.090 [initandlisten] MongoDB starting : pid=28452 port=27017 dbpath=/home/deploy/data/db 64-bit host=stockgame-with-login
Sun Jan 10 15:16:22.091 [initandlisten] db version v2.4.14
Sun Jan 10 15:16:22.092 [initandlisten] git version: 05bebf9ab15511a71bfbded684bb226014c0a553
Sun Jan 10 15:16:22.092 [initandlisten] build info: Linux ip-10-154-253-119 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Sun Jan 10 15:16:22.092 [initandlisten] allocator: tcmalloc
Sun Jan 10 15:16:22.093 [initandlisten] options: { dbpath: "/home/deploy/data/db" }
Sun Jan 10 15:16:22.098 [initandlisten] journal dir=/home/deploy/data/db/journal
Sun Jan 10 15:16:22.099 [initandlisten] recover : no journal files present, no recovery needed
Sun Jan 10 15:16:22.209 [initandlisten] ****
Sun Jan 10 15:16:22.210 [initandlisten] ****
Sun Jan 10 15:16:22.210 [initandlisten] need to upgrade database local with pdfile version 4.22, new version: 4.5
Sun Jan 10 15:16:22.210 [initandlisten] Not upgrading, exiting
Sun Jan 10 15:16:22.210 [initandlisten] run --upgrade to upgrade dbs, then start again
Sun Jan 10 15:16:22.210 [initandlisten] ****
Sun Jan 10 15:16:22.210 dbexit:
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: going to close listening sockets...
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: going to flush diaglog...
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: going to close sockets...
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: waiting for fs preallocator...
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: lock for final commit...
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: final commit...
Sun Jan 10 15:16:22.211 [initandlisten] shutdown: closing all files...
Sun Jan 10 15:16:22.213 [initandlisten] closeAllFiles() finished
Sun Jan 10 15:16:22.213 [initandlisten] journalCleanup...
Sun Jan 10 15:16:22.213 [initandlisten] removeJournalFiles
Sun Jan 10 15:16:22.214 [initandlisten] shutdown: removing fs lock...
Sun Jan 10 15:16:22.215 dbexit: really exiting now
deploy#stockgame-with-login:~$
You need to run
mongod --dbpath ~/data/db --upgrade
The current database you are pointing appears to be from an older version of Mongo and it's format is deprecated.
Beware that this --upgrade argument will most likely not be backwards compatible, and older Mongo versions will not be able to read it. If that's not acceptable, you will need to open the database with an older version of Mongo such as 2.6.

Unable to start MongoDB. ERROR: addr already in use

I tried running MongoDB in local server with mongod command and it failed to run. The error:
mongod --help for help and startup options
Sat Jan 31 13:07:16.392 [initandlisten] MongoDB starting : pid=5127 port=27017 dbpath=/data/db/ 64-bit host=leandrotk
Sat Jan 31 13:07:16.392 [initandlisten] db version v2.4.9
Sat Jan 31 13:07:16.392 [initandlisten] git version: nogitversion
Sat Jan 31 13:07:16.392 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54
Sat Jan 31 13:07:16.392 [initandlisten] allocator: tcmalloc
Sat Jan 31 13:07:16.392 [initandlisten] options: {}
Sat Jan 31 13:07:16.435 [initandlisten] journal dir=/data/db/journal
Sat Jan 31 13:07:16.435 [initandlisten] recover : no journal files present, no recovery needed
Sat Jan 31 13:07:16.513 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
Sat Jan 31 13:07:16.514 [initandlisten] ERROR: addr already in use
Sat Jan 31 13:07:16.514 [websvr] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:28017
Sat Jan 31 13:07:16.514 [initandlisten] now exiting
Sat Jan 31 13:07:16.514 [websvr] ERROR: addr already in use
Sat Jan 31 13:07:16.514 dbexit:
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: going to close listening sockets...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: going to flush diaglog...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: going to close sockets...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: waiting for fs preallocator...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: lock for final commit...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: final commit...
Sat Jan 31 13:07:16.599 [initandlisten] shutdown: closing all files...
Sat Jan 31 13:07:16.599 [initandlisten] closeAllFiles() finished
Sat Jan 31 13:07:16.599 [initandlisten] journalCleanup...
Sat Jan 31 13:07:16.599 [initandlisten] removeJournalFiles
Sat Jan 31 13:07:16.668 [initandlisten] shutdown: removing fs lock...
Sat Jan 31 13:07:16.668 dbexit: really exiting now
you already have a process running
killall mongod
should kill the other process, if you have another kind of process bound to that port you could find it with netstat | grep 27017
Try this:
sudo service mongodb stop
sudo mongod
some version is:
sudo service mongod stop
mongod: mongo damon

mongo db quits immediately

Just started working with mongoDB. At first commands received no response, and now it immediately quits. Any ideas of what is going wrong/how I can find out whats going wrong?
Here is the terminal output:
new-host-4:~ Brennan$ mongod
all output going to: /usr/local/var/log/mongodb/mongo.log
new-host-4:~ Brennan$
Thanks!
This is the output from the log:
Sun Jun 15 21:24:50.010 [initandlisten] MongoDB starting : pid=8253 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=new-host-4.home
Sun Jun 15 21:24:50.010 [initandlisten]
Sun Jun 15 21:24:50.010 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Sun Jun 15 21:24:50.010 [initandlisten] db version v2.4.8
Sun Jun 15 21:24:50.010 [initandlisten] git version: nogitversion
Sun Jun 15 21:24:50.010 [initandlisten] build info: Darwin new-host-4.home 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_6$
Sun Jun 15 21:24:50.010 [initandlisten] allocator: tcmalloc
Sun Jun 15 21:24:50.010 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb", logappend: "true", logpath: "/us$
Sun Jun 15 21:24:50.011 [initandlisten] journal dir=/usr/local/var/mongodb/journal
Sun Jun 15 21:24:50.011 [initandlisten] recover : no journal files present, no recovery needed
Sun Jun 15 21:24:50.026 [FileAllocator] allocating new datafile /usr/local/var/mongodb/local.ns, filling with zeroes...
Sun Jun 15 21:24:50.026 [FileAllocator] creating directory /usr/local/var/mongodb/_tmp
Sun Jun 15 21:24:50.080 [FileAllocator] done allocating datafile /usr/local/var/mongodb/local.ns, size: 16MB, took 0.054 secs
Sun Jun 15 21:24:50.085 [FileAllocator] allocating new datafile /usr/local/var/mongodb/local.0, filling with zeroes...
Sun Jun 15 21:24:50.252 [FileAllocator] done allocating datafile /usr/local/var/mongodb/local.0, size: 64MB, took 0.166 secs
Sun Jun 15 21:24:50.280 [initandlisten] command local.$cmd command: { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0 reslen:37 254ms
Sun Jun 15 21:24:50.280 [websvr] admin web console waiting for connections on port 28017
Sun Jun 15 21:24:50.281 [initandlisten] waiting for connections on port 27017
Sun Jun 15 22:28:03.428 [signalProcessingThread] got signal 1 (Hangup: 1), will terminate after current cmd ends
Sun Jun 15 22:28:03.428 [signalProcessingThread] now exiting
Sun Jun 15 22:28:03.429 dbexit:
Sun Jun 15 22:28:03.429 [signalProcessingThread] shutdown: going to close listening sockets...
Sun Jun 15 22:28:03.429 [signalProcessingThread] closing listening socket: 9
Sun Jun 15 22:28:03.429 [signalProcessingThread] closing listening socket: 10
Sun Jun 15 22:28:03.429 [signalProcessingThread] closing listening socket: 11
Sun Jun 15 22:28:03.429 [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
Sun Jun 15 22:28:03.429 [signalProcessingThread] shutdown: going to flush diaglog...
Sun Jun 15 22:28:03.429 [signalProcessingThread] shutdown: going to close sockets...
Sun Jun 15 22:28:03.429 [signalProcessingThread] shutdown: waiting for fs preallocator...
Sun Jun 15 22:28:03.429 [signalProcessingThread] shutdown: lock for final commit...
Sun Jun 15 22:28:03.429 [signalProcessingThread] shutdown: final commit...
Sun Jun 15 22:28:03.437 [signalProcessingThread] shutdown: closing all files...
Sun Jun 15 22:28:03.438 [signalProcessingThread] closeAllFiles() finished
Sun Jun 15 22:28:03.438 [signalProcessingThread] journalCleanup...
Sun Jun 15 22:28:03.438 [signalProcessingThread] removeJournalFiles
Sun Jun 15 22:28:03.438 [signalProcessingThread] shutdown: removing fs lock...
Sun Jun 15 22:28:03.438 dbexit: really exiting now
It has started to stay open now but commands don't seem to do anything. Sorry, I cant narrow it down further I am new to mongodb. I'm on a mac using terminal and by typing "help" and then pressing return I should get some sort of response right?
Thanks again!
Figured it out after looking some stuff up on youtube. I was confused as I was coming from a MYSQL background. mongodstarts the server but you need to use mongo to access the shell (I just opened a new terminal wind

MongoDb Bind_ip error: bind() failed errno:10049

My MongoDb Config file Content Is as below:
port=22000
bind_ip=127.0.0.1,192.168.1.121
auth=true
dbpath=D:\Data_For_Mongo
I am running my mongod instance using following command:
mongod -f "D:\mongoConfig.conf"
It Gives Me following Error:
ERROR: listen(): bind() failed errno:10049 The requested address is not valid in its context. for socket: 192.168.1.121:22000
The Whole Stack trace is As Below:
Fri Apr 11 09:24:18.600 [initandlisten] MongoDB starting : pid=3780 port=22000 dbpath=D:\Data_For_Mongo 64-bit host=SLK055
Fri Apr 11 09:24:18.600 [initandlisten] db version v2.4.6
Fri Apr 11 09:24:18.600 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Fri Apr 11 09:24:18.600 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
Fri Apr 11 09:24:18.615 [initandlisten] allocator: system
Fri Apr 11 09:24:18.615 [initandlisten] options: { auth: "true", bind_ip: "192.168.1.80,192.168.1.121", config: "D:\mongoConfig.conf", dbpath: "D:\Data_For_Mongo", port: 22000 }
Fri Apr 11 09:24:18.647 [initandlisten] journal dir=D:\Data_For_Mongo\journal
Fri Apr 11 09:24:18.647 [initandlisten] recover : no journal files present, no recovery needed
Fri Apr 11 09:24:18.709 [initandlisten] ERROR: listen(): bind() failed errno:10049 The requested address is not valid in its context. for socket: 192.168.1.121:22000
Fri Apr 11 09:24:18.709 [websvr] ERROR: listen(): bind() failed errno:10049 The requested address is not valid in its context. for socket: 192.168.1.121:23000
Fri Apr 11 09:24:18.709 [initandlisten] now exiting
Fri Apr 11 09:24:18.725 dbexit:
Fri Apr 11 09:24:18.725 [initandlisten] shutdown: going to close listening sockets...
Fri Apr 11 09:24:18.740 [initandlisten] closing listening socket: 528
Fri Apr 11 09:24:18.740 [initandlisten] closing listening socket: 552
Fri Apr 11 09:24:18.740 [initandlisten] shutdown: going to flush diaglog...
Fri Apr 11 09:24:18.756 [initandlisten] shutdown: going to close sockets...
Fri Apr 11 09:24:18.756 [initandlisten] shutdown: waiting for fs preallocator...
Fri Apr 11 09:24:18.772 [initandlisten] shutdown: lock for final commit...
Fri Apr 11 09:24:18.772 [initandlisten] shutdown: final commit...
Fri Apr 11 09:24:18.834 [initandlisten] shutdown: closing all files...
Fri Apr 11 09:24:18.834 [initandlisten] closeAllFiles() finished
Fri Apr 11 09:24:18.834 [initandlisten] journalCleanup...
Fri Apr 11 09:24:18.834 [initandlisten] removeJournalFiles
Fri Apr 11 09:24:18.850 [initandlisten] shutdown: removing fs lock...
Fri Apr 11 09:24:18.850 dbexit: really exiting now
Bind Multiple ips is important for me.
Can AnyOne Help Me To Solve This Error?
I Have searched about error but can't find any way to bind multiple ips in mongo.
Thats a Windows Socket error. This is normally due to the IP address you are trying to bind to not being the IP of your local machine. You should double check that your system actually has the IP of 192.168.1.121

Start mongo failed

I get an error when I try to start mongo using the "mongod" command (on Macintosh).
all output going to: /usr/local/var/log/mongodb/mongo.log
My logs :
***** SERVER RESTARTED *****
Tue Oct 29 13:15:48.783 [initandlisten] MongoDB starting : pid=859 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=MacBook-Pro-de-Anthony
Tue Oct 29 13:15:48.784 [initandlisten] db version v2.4.4
Tue Oct 29 13:15:48.784 [initandlisten] git version: 4ec1fb96702c9d4c57b1e06dd34eb73a16e407d2
Tue Oct 29 13:15:48.784 [initandlisten] build info: Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Tue Oct 29 13:15:48.784 [initandlisten] allocator: system
Tue Oct 29 13:15:48.784 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb", logappend: "true", logpath: "/usr/local/var/log/mongodb/mongo.log" }
Tue Oct 29 13:15:48.784 [initandlisten] journal dir=/usr/local/var/mongodb/journal
Tue Oct 29 13:15:48.784 [initandlisten] recover : no journal files present, no recovery needed
Tue Oct 29 13:15:48.801 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 127.0.0.1:27017
Tue Oct 29 13:15:48.801 [websvr] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 127.0.0.1:28017
Tue Oct 29 13:15:48.801 [initandlisten] ERROR: addr already in use
Tue Oct 29 13:15:48.801 [websvr] ERROR: addr already in use
Tue Oct 29 13:15:48.801 [initandlisten] now exiting
Tue Oct 29 13:15:48.801 dbexit:
Tue Oct 29 13:15:48.801 [initandlisten] shutdown: going to close listening sockets...
Tue Oct 29 13:15:48.801 [initandlisten] shutdown: going to flush diaglog...
Tue Oct 29 13:15:48.801 [initandlisten] shutdown: going to close sockets...
Tue Oct 29 13:15:48.801 [initandlisten] shutdown: waiting for fs preallocator...
Tue Oct 29 13:15:48.801 [initandlisten] shutdown: lock for final commit...
Tue Oct 29 13:15:48.801 [initandlisten] shutdown: final commit...
Tue Oct 29 13:15:48.802 [initandlisten] shutdown: closing all files...
Tue Oct 29 13:15:48.802 [initandlisten] closeAllFiles() finished
Tue Oct 29 13:15:48.802 [initandlisten] journalCleanup...
Tue Oct 29 13:15:48.802 [initandlisten] removeJournalFiles
Tue Oct 29 13:15:48.803 [initandlisten] shutdown: removing fs lock...
Tue Oct 29 13:15:48.803 dbexit: really exiting now
UPDATE:
When I execute the "mongo" command :
MacBook-Pro-de-Anthony:Sites anthonycluse$ mongo
MongoDB shell version: 2.4.4
connecting to: test
Server has startup warnings:
Tue Oct 29 11:43:15 [initandlisten]
Tue Oct 29 11:43:15 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
> show dbs;
anthonycluse (empty)
local (empty)
>
It means that the username is "test" no?
UPDATE 2 :
The "show users;" command :
MacBook-Pro-de-Anthony:Sites anthonycluse$ mongo
MongoDB shell version: 2.4.4
connecting to: test
Server has startup warnings:
Tue Oct 29 11:43:15 [initandlisten]
Tue Oct 29 11:43:15 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
> show users;
>
Is there another process listening on those ports? Try finding out with:
netstat -tulpen | grep 017 # 017 for both port 27017 and 28017
Kill that process if you're sure you don't need it. As answered below by Lix, there may already be a mongo process running.
The answer is right there in side the log file:
Tue Oct 29 13:15:48.801 [websvr] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 127.0.0.1:28017
Specifically this part: "Address already in use for socket: 127.0.0.1:28017"
It seems that there is already a mongo instance running on that default port 27017. It might not even be a mongo instance but some other application that is using that port.
As per the logs it is clear that there is another mongodb instance running on default, i believe you installed mongodb using rpm and started this service using service mongodb start. so when the server restarts by default it starts some of the services, using defaultconfiguration which will be avialble in /etc/mongod.config edit this file or stop the one which is running already so you can avoid the mongod default instamce and made ur version to up and running