Giter Club home page Giter Club logo

mongodb-orangepi's Introduction

MongoDb for OrangePI

MongoDb 3.2.12 for Orange Pi precompiled binaries for 32 bit armv7l.

WARNING

This 32-bit legacy distribution does not include SSL encryption and is limited to around 2GB of data. In general you should use the 64 bit builds.

Install

Create mongodb user and folders needed

sudo adduser --ingroup nogroup --shell /etc/false --disabled-password --gecos "" \
--no-create-home mongodb

sudo mkdir /var/log/mongodb
sudo chown mongodb:nogroup /var/log/mongodb

sudo mkdir /var/lib/mongodb
sudo chown mongodb:root /var/lib/mongodb
sudo chmod 775 /var/lib/mongodb

Clone this repo and copy binaries files, configuration and service

git clone https://github.com/robertsLando/MongoDB-OrangePI.git

cd MongoDB-OrangePI
sudo cp mongodb.conf /etc
sudo cp mongodb.service /lib/systemd/system

cd bin
sudo chown root:root mongo*
sudo chmod 755 mongo*
sudo cp -p mongo* /usr/bin

sudo systemctl start mongodb
sudo systemctl status mongodb

Enable mongodb on startup

sudo systemctl enable mongodb

Fix Mongo if not working

Sometimes mongo could need recovery, run this commands to recover the db

sudo -u mongodb mongod --repair --dbpath /var/lib/mongodb/
sudo service mongodb restart

Build mongo from source

#Download mongo
mkdir install
cd install
wget https://fastdl.mongodb.org/src/mongodb-src-r3.2.12.tar.gz
tar xvf mongodb-src-r3.2.12.tar.gz
cd mongodb-src-r3.2.12

##Install required package for compiling
sudo aptitude install scons build-essential
sudo aptitude install libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev
sudo aptitude install python-pymongo

#Increese swap space
sudo dd if=/dev/zero of=/mytempswapfile bs=1024 count=524288
sudo chmod 0600 /mytempswapfile
sudo mkswap /mytempswapfile
sudo swapon /mytempswapfile

#Generate additional sources
cd src/third_party/mozjs-38/
./get_sources.sh
./gen-config.sh arm linux
cd -

#Start compiling
scons mongo mongod -j4 --disable-warnings-as-errors --wiredtiger=off --mmapv1=on --warn=no-all

#Strip binaries files to reduce space usage
cd build/opt/mongo
sudo strip mongo*

##Reboot system and remove swap file

sudo reboot
sudo rm -rf /mytempswapfile

You will find your compiled binaries on build/opt/mongo. Now you can copy your binaries in the usr/bin and create the mongodb conf and service file by following Install section

Snapshot

Mongo Shell

Sources

Thanks to:

mongodb-orangepi's People

Contributors

robertslando avatar goreevartem 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.