Skip to content

Setup Linux host machine

manaswis edited this page Jan 31, 2013 · 16 revisions

STEP I: Setting up host machine

Prerequisite: The host machine should run a 64 bit version of the operating system. Steps:

  1. Open a terminal in the host machine
  2. Download and install mongodb-2.0.5 64bit (32bit version has a limitation of 2GB data space)
    $ sudo wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.5.tgz

wget-mongodb
If you want to install the 32 bit version, use the following command:
$ sudo wget http://downloads.mongodb.org/linux/mongodb-linux-i686-2.0.5.tgz
and extract the corresponding downloaded file by replacing the mongodb-linux-x86_64-2.0.5.tgz with mongodb-linux-i686-2.0.5.tgz in the following command:

$ sudo tar -C /opt -zxvf mongodb-linux-x86_64-2.0.5.tgz

extract-mongodb

$ sudo mkdir -p /data/db/
$ sudo chown `id -u` /data/db

mkdir-data

Assuming you extracted mongodb tar file to /opt/mongodb-linux-x86_64-2.0.5/,
$ sudo ln -s /opt/mongodb-linux-x86_64-2.0.5/bin/mongod /usr/bin/mongod
$ sudo ln -s /opt/mongodb-linux-x86_64-2.0.5/bin/mongo /usr/bin/mongo
$ mongod
This starts the MongoDB database process. "waiting connections" will be displayed once the process starts.

mongod

Testing MongoDB process

(i) Open a new terminal and type      
	`$ mongo`    
(ii) Type the following commands in the newly opened command prompt window (from the above command)   
	`> db.test.save( { a: 1 } )`   
`> db.test.find()`    
You should be able to see-    
 `{ "_id" : ObjectId("50af218a0e4451a45194eed5"), "a" : 1 }`   
The displayed ObjectId can be different on your system. If you see this, then mongoDB has been started successfully.   
 (iii)Type Ctrl + C to exit mongo shell and close this terminal.   

mongo The "mongod" service should still be running in the first terminal.

IMPORTANT: Make sure to start mongod service before you start the SensorAct system.

NEXT: Setup SensorAct System