Giter VIP home page Giter VIP logo

mongo-arm's Introduction

MongoDB for ARM

This is a distribution of the MongoDB binaries built for the ARM architecture. Specifically these were built to run MongoDB on a Raspberry Pi. This was tested and built using a Model B Pi running Raspbian Wheezy 3.6.11+ Available for Download Here

I can only take credit for compiling these instructions in one place, and providing a compiled set of binaries. These binaries and instructions are based on information from the following links:

Compiling MongoDB

Building MongoDB on the Raspberry Pi - mongopi

Setting Up MongoDB as A Service

Issues

  • The mongo shell causes Segmentation Fault errors when running "show dbs;" and sometimes when querying collections. NOTE: the pymongo driver is tested and works well against this installation process. It appears only the shell has this issue.

Installation Steps:

  1. Download binaries

    #Clone this repository
    git clone https://github.com/Barryrowe/mongo-arm.git
  2. Create the mongo user

    sudo useradd mongo
    sudo passwd mongo
  3. Copy the mongo binaries to the desired install location

    #example:
    cp -R binaries/2.1.1 /opt/mongo
  4. Change the ownership of the installed mongo binaries so they are owned by the mongo user

    chown -R mongo:mongo /path/to/installed/binaries
  5. Creat the /data/db directory for MongoDB's data storage

    sudo mkdir /data
    sudo mkdir /data/db
  6. Change the ownership of the /data/db directory so it is owned by the mongo user

    sudo chown mongo:mongo /data/db

Set As Service Steps (Debian)

  1. Copy config/mongodb to the init.d location

    sudo cp config/mongodb /etc/init.d/mongodb
  2. Update /etc/init.d/mongodb to point to your install path from step 3

    A. Line 50 will need to be modified to point to the mongos executable from your install path in step 3.

    B. If you created a user with name other than "mongo" in step 2 you will need to update Line 95 with the user you configured.

  3. Update the permissions for the mongodb init.d file so it can be executed

    sudo chmod 755 /etc/init.d/mongodb
  4. Copy the config/mongod.conf file to /etc/mongod.conf

    sudo cp config/mongod.conf /etc/mongod.conf
  5. Register the mongodb service

    sudo update-rc.d mongodb defaults
  6. Startup the service

    sudo service mongodb start

Managing MongoDB After Install and Setting as Service

Once installed and configured, you can use these commands to manage the mongodb service you've setup.

#start the service
sudo service mongodb start

#check the service status
service mongodb status

#stop the service
sudo service mongodb stop

If your mongodb service won't start you might just get output like this:

....] Starting database: mongod/etc/init.d/mongodb: 131: ulimit: Illegal option -u
numactl: 
daemuser: mongo
pidfile: /var/run/mongod.pid
daem: /opt/mongo/bin/mongod
daemopts: -- --config /etc/mongod.conf
. failed

NOTE: In this case, make sure to check the /data/db/ directory for a file mongod.lock. If mongodb isn't stopped cleanly, the mongod process can leave this lock file in place preventing the service from properly starting. Usually you can just remove the file and mongodb will start normally

#remove mongod.lock file after unclean shutdown
sudo rm /data/db/mongod.lock

mongo-arm's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.