- Notifications
You must be signed in to change notification settings - Fork9
robertsLando/MongoDB-OrangePI
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
Create mongodb user and folders needed
sudo adduser --ingroup nogroup --shell /etc/false --disabled-password --gecos"" \--no-create-home mongodbsudo mkdir /var/log/mongodbsudo chown mongodb:nogroup /var/log/mongodbsudo mkdir /var/lib/mongodbsudo chown mongodb:root /var/lib/mongodbsudo chmod 775 /var/lib/mongodb
Clone this repo and copy binaries files, configuration and service
git clone https://github.com/robertsLando/MongoDB-OrangePI.gitcd MongoDB-OrangePIsudo cp mongodb.conf /etcsudo cp mongodb.service /lib/systemd/systemcd binsudo chown root:root mongo*sudo chmod 755 mongo*sudo cp -p mongo* /usr/binsudo systemctl start mongodbsudo systemctl status mongodb
Enable mongodb on startup
sudo systemctlenable mongodb
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
#Download mongomkdir installcd installwget https://fastdl.mongodb.org/src/mongodb-src-r3.2.12.tar.gztar xvf mongodb-src-r3.2.12.tar.gzcd mongodb-src-r3.2.12##Install required package for compilingsudo aptitude install scons build-essentialsudo aptitude install libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-devsudo aptitude install python-pymongo#Increese swap spacesudo dd if=/dev/zero of=/mytempswapfile bs=1024 count=524288sudo chmod 0600 /mytempswapfilesudo mkswap /mytempswapfilesudo swapon /mytempswapfile#Generate additional sourcescd src/third_party/mozjs-38/./get_sources.sh./gen-config.sh arm linuxcd -#Start compilingscons mongo mongod -j4 --disable-warnings-as-errors --wiredtiger=off --mmapv1=on --warn=no-all#Strip binaries files to reduce space usagecd build/opt/mongosudo strip mongo*##Reboot system and remove swap filesudo rebootsudo rm -rf /mytempswapfile
You will find your compiled binaries onbuild/opt/mongo
. Now you can copy your binaries in theusr/bin
and create the mongodb conf and service file by followingInstall section
Thanks to:
- Mongo binaries configuration and service:https://andyfelong.com/2016/01/mongodb-3-0-9-binaries-for-raspberry-pi-2-jessie/
- Mongo binaries compile:http://koenaerts.ca/compile-and-install-mongodb-on-raspberry-pi/