Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have installed mongodb using sudo pacman -S mongodb in my 32-bit arch .
At first I run this sudo mkdir -p /data/db to create /data/db ,and then run $ mongod ,then I got the following message :

mongod --help for help and startup options
Sat Oct  6 11:45:29 
Sat Oct  6 11:4
5:29 warning: 32-bit servers don't have journaling enabled by default. Please use --           journal if you want durability.
Sat Oct  6 11:45:29 
Sat Oct  6 11:45:29 [initandlisten] MongoDB starting : pid=1146 port=27017    dbpath=/data/db/ 32-bit host=ftp
Sat Oct  6 11:45:29 [initandlisten] 
Sat Oct  6 11:45:29 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Sat Oct  6 11:45:29 [initandlisten] **       see    http://blog.mongodb.org/post/137788967/32-bit-limitations
Sat Oct  6 11:45:29 [initandlisten] **       with --journal, the limit is lower
Sat Oct  6 11:45:29 [initandlisten]  
Sat Oct  6 11:45:29 [initandlisten] db version v2.2.0, pdfile version 4.5
Sat Oct  6 11:45:29 [initandlisten] git version: nogitversion
Sat Oct  6 11:45:29 [initandlisten] build info: Linux brynhild 3.5.3-1-ARCH #1 SMP   PREEMPT Sun Aug 26 09:14:51 CEST 2012 i686 BOOST_LIB_VERSION=1_49
Sat Oct  6 11:45:29 [initandlisten] options: {}
Sat Oct  6 11:45:29 [initandlisten] exception in initAndListen: 10309 Unable to   create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance  already running?, terminating
Sat Oct  6 11:45:29 dbexit: 
Sat Oct  6 11:45:29 [initandlisten] shutdown: going to close listening sockets...
Sat Oct  6 11:45:29 [initandlisten] shutdown: going to flush diaglog...
Sat Oct  6 11:45:29 [initandlisten] shutdown: going to close sockets...
Sat Oct  6 11:45:29 [initandlisten] shutdown: waiting for fs preallocator...
Sat Oct  6 11:45:29 [initandlisten] shutdown: closing all files... 
Sat Oct  6 11:45:29 [initandlisten] closeAllFiles() finished
Sat Oct  6 11:45:29 [initandlisten] shutdown: removing fs lock...
Sat Oct  6 11:45:29 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
Sat Oct  6 11:45:29 dbexit: really exiting now

what does exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating mean?

share|improve this question
    
even earlier there is indication that this is the wrong executable - you are on 64-bit architecture but this is a 32-bit mongoDB which is NOT suitable for production. Permission denied could just be that /data/db directory is owned by a different user than you are starting the mongod process as. –  Asya Kamsky Oct 6 '12 at 3:14
    
@Asya Kamsky ,sorry for my mistake that it is 32-bit not 64-bit arch . –  holys Oct 6 '12 at 3:17
    
my mongodb.log gist.github.com/3843639 . I am newbie to mongodb & node.js –  holys Oct 6 '12 at 3:18
    
I strongly recommend against using 32-bit platform for mongodb. As far as the error, you are starting mongod as some user, but you probably created the /data/db directory as another user. the permissions are such that mongod cannot create the files it needs. fix permissions. –  Asya Kamsky Oct 6 '12 at 3:22
    
What's the difference between command $ sudo rc.d start mongodb and $ sudo mongod to start mongodb service ? For me ,sudo rc.d start mongodb works but $ sudo mongod or $ mongod can't . –  holys Nov 23 '12 at 2:51
add comment

migrated from stackoverflow.com Oct 8 '12 at 4:19

This question came from our site for professional and enthusiast programmers.

1 Answer

You ran sudo mkdir -p /data/db as not yourself. Now that directory is owned by root.

You need to chown the directory back to yourself before starting mongod otherwise mongod cannot access the directory write the files into it that are needed.

Please also find a 64-bit platform to run mongo - it's not really a very good idea to run it on 32-bit system unless this is just for playing around with.

share|improve this answer
    
What's the recommended way to install mongodb ? Is it using npm install mongodb or package magager like pacman or download the source code to ./configure & make & make install? –  holys Oct 6 '12 at 3:40
    
After reinstall mongodb using pacman ,it works ! –  holys Oct 6 '12 at 4:07
    
great. if my answer helped you, feel free to accept it. –  Asya Kamsky Oct 6 '12 at 5:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.