Build mongodb from source code on Ubuntu

If you want build mongodb from source code we need at least 2G RAM and 25G storage.

Install scons

Build the source code

Install

 

Error fixes

“collect2: error: ld terminated with signal 9 [Killed]” If saw this which maybe you need more memory or more swap.

“collect2: error: ld returned 1 exit status” this is maybe because you don’t have enough space.

Create configure file /usr/local/mongodb/etc/mongod.conf

create files or directories base on the config file:

Set the PATH variable

Add the following lines to the ~/.profile

Start Mongodb Daemon

Error fixes:

sudo error: command not found

Leave a Reply

Your email address will not be published. Required fields are marked *