MongoDB on a 32 bit Ubuntu

200 views
Skip to first unread message

Joe San

unread,
Mar 18, 2014, 3:16:38 AM3/18/14
to mongod...@googlegroups.com
I just installed a 32 bit version of the MongoDB on my Ubuntu machine and as soon as I started it, I got the following error on the console:

ue Mar 18 08:09:20.129
Tue Mar 18 08:09:20.129 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Tue Mar 18 08:09:20.129
Tue Mar 18 08:09:20.140 [initandlisten] MongoDB starting : pid=8344 port=27017 dbpath=/opt/softwares/data/ 32-bit host=xxxr.com
Tue Mar 18 08:09:20.140 [initandlisten]
Tue Mar 18 08:09:20.140 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Tue Mar 18 08:09:20.140 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Tue Mar 18 08:09:20.140 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
Tue Mar 18 08:09:20.140 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Tue Mar 18 08:09:20.140 [initandlisten]
Tue Mar 18 08:09:20.140 [initandlisten] ** WARNING: You are running in OpenVZ. This is known to be broken!!!
Tue Mar 18 08:09:20.141 [initandlisten]
Tue Mar 18 08:09:20.141 [initandlisten] db version v2.4.9
Tue Mar 18 08:09:20.141 [initandlisten] git version: 52fe0d21959e32a5bdbecdc62057db386e4e029c
Tue Mar 18 08:09:20.141 [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
Tue Mar 18 08:09:20.141 [initandlisten] allocator: system
Tue Mar 18 08:09:20.141 [initandlisten] options: { dbpath: "/opt/softwares/data/" }
Tue Mar 18 08:09:20.141 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /opt/softwares/data/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Tue Mar 18 08:09:20.141 dbexit:
Tue Mar 18 08:09:20.141 [initandlisten] shutdown: going to close listening sockets...
Tue Mar 18 08:09:20.141 [initandlisten] shutdown: going to flush diaglog...
Tue Mar 18 08:09:20.141 [initandlisten] shutdown: going to close sockets...
Tue Mar 18 08:09:20.141 [initandlisten] shutdown: waiting for fs preallocator...
Tue Mar 18 08:09:20.141 [initandlisten] shutdown: closing all files...
Tue Mar 18 08:09:20.141 [initandlisten] closeAllFiles() finished
Tue Mar 18 08:09:20.141 [initandlisten] shutdown: removing fs lock...
Tue Mar 18 08:09:20.141 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
Tue Mar 18 08:09:20.141 dbexit: really exiting now

I have the following questions:

1. Can I install and run a 64 bit version of MongoDB on my 32 bit Ubuntu? If so what would be the difference?
2. Is the Permission denied error linked to the mongodb user? Because the MongoDB is owned by another user and there is another user that is trying to start the server and this user does not belong to the mongodb group.

Stephen Steneker

unread,
Mar 18, 2014, 4:48:17 AM3/18/14
to mongod...@googlegroups.com
On Tuesday, 18 March 2014 18:16:38 UTC+11, Joe San wrote:
I just installed a 32 bit version of the MongoDB on my Ubuntu machine and as soon as I started it, I got the following error on the console:

Hi Joe,

There are several startup warnings here .. I'll comment on those briefly before your specific questions.

> Tue Mar 18 08:09:20.140 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
> Tue Mar 18 08:09:20.140 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
> Tue Mar 18 08:09:20.140 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
> Tue Mar 18 08:09:20.140 [initandlisten] **       See http://dochub.mongodb.org/core/32bit

Per the message and documentation link, this is a warning regarding limitations of 32-bit builds. 32-bit is OK for development if that's all you have access to, but you ideally want to be running a 64-bit build and have journaling enabled.

> Tue Mar 18 08:09:20.140 [initandlisten] ** WARNING: You are running in OpenVZ. This is known to be broken!!!

This warning is a holdover from older versions of OpenVZ which were problematic before RHEL6. Newer OpenVZ versions are apparently OK, and this warning has been changed in MongoDB 2.6: https://jira.mongodb.org/browse/SERVER-8606.

What specific version of Ubuntu are you running?

> Tue Mar 18 08:09:20.141 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /opt/softwares/data/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating

This is a fatal error, not a warning. It indicates that either another `mongod` instance is already running, or this `mongod` does not have appropriate permissions to create/open the lock file in the given path.

> I have the following questions:
>
> 1. Can I install and run a 64 bit version of MongoDB on my 32 bit Ubuntu? If so what would be the difference?

No, you need a 64-bit O/S to run a 64-bit server build. The most important difference is the amount of addressable memory for memory-mapped files, which the MongoDB storage engine relies on: http://docs.mongodb.org/manual/faq/storage/.

> 2. Is the Permission denied error linked to the mongodb user? Because the MongoDB is owned by another user and there is another user that is trying to start the server and this user does not belong to the mongodb group.

The `mongod` process needs to own the data directories used, so if you created the path /opt/softwares/data/ as another user you will need to chown this to the same user as the `mongod` server.

It's worth noting that `mongod` does not need to run as root, and best practice is normally to have a specific mongod user.

If you install from the .deb packages the service and data directories will already be set up correctly, so this may be an easier install path: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/.

Regards,
Stephen
Reply all
Reply to author
Forward
0 new messages