Sunday, June 16, 2013

MongoDB 2.1.1 / Raspberry Pi Install

Setting up & configuring your Raspberry Pi + Installing MongoDB 2.1.1.

You must first install the OS to your SD card.
Download the OS from http://www.raspberrypi.org/downloads
I use Raspbian Wheezy but there are other choices.
You'll need an installer as well to format the SD Card and install the OS.
Check out: http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2.pdf

Once you Pi is running, the follow the steps below.

1. From the config menu, select "Enable SSH"

2. Change your password

3. Expand root to fill SD Card & reboot

4. Test available space: df -k

5. To re-enter the config screen:
sudo raspi-config

6. Set timezone

7. Find the IP address from the router and SSH to the Pi from another computer.
ssh pi@192.168.1.XX

8. Set static IP address.
sudo vi /etc/network/interfaces

Change: iface eth0 inet dhcp
To:

iface eth0 inet static
address 192.168.1.XX
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
network 192.168.1.0

Once the file is saved, you must reboot for the changes to take effect.
sudo reboot

9. Install VNC Server:
sudo apt-get install tightvncserver

This must be run after every Pi restart:
vncserver :1 -geometry 800x600 -depth 24

10. Connect using RealVNC Client

11. Shutdown and take a backup the SD Card.
sudo shutdown -h now


--- MongoDB Install 2.1.1 --------------------------------------------
(Thank you RickP for this install)

1. Reboot the Pi and login through ssh

2. Installing the supporting softwares. (This will take a few minutes)

sudo apt-get install git-core build-essential scons libpcre++-dev xulrunner-dev libboost-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev

3. Checkout this repo:
git clone git://github.com/RickP/mongopi.git

4. Build it (this will take very long! Hours!):

    cd mongopi
    scons

5. Install it:

    sudo scons --prefix=/opt/mongo install

6. Install mongo in /opt/mongo, to get other programs to see it, you can add this dir to your $PATH:

    PATH=$PATH:/opt/mongo/bin/
    export PATH

7. Create a directory for your MongoDB data files.

   cd
   mkdir mongoData
   cd mongoData
   pwd

8. Start MongoDB:
   ./mongod --dbpath /home/pi/mongoData

No comments:

Post a Comment