0

I use nodejs and usually I work with mongodb. But I read it is not recommended to run mongodb with 32bit:

Discussion on Databases for PI + Nodejs

Limitations in 32Bit Mode

Also I wasn't able to get the mongodb running.

Requirements

I'm looking for a

  • schema-less database
  • which supports non-blocking operations
  • easy to install
  • the query style is similar to mongodb
  • which runs stable on the pi

I'm not storing a lot of information in the db. Basically just some logs and users.

Installation

I fail with the first step of the installation guide:

Installing the package libboost-dev always fails.

sudo apt-get install libboost-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libboost1.55-dev
Suggested packages:
  libboost-doc libboost1.55-doc libboost-atomic1.55-dev libboost-chrono1.55-dev libboost-context1.55-dev
  libboost-coroutine1.55-dev libboost-date-time1.55-dev libboost-exception1.55-dev
  libboost-filesystem1.55-dev libboost-graph1.55-dev libboost-graph-parallel1.55-dev
  libboost-iostreams1.55-dev libboost-locale1.55-dev libboost-log1.55-dev libboost-math1.55-dev
  libboost-mpi1.55-dev libboost-mpi-python1.55-dev libboost-program-options1.55-dev
  libboost-python1.55-dev libboost-random1.55-dev libboost-regex1.55-dev libboost-serialization1.55-dev
  libboost-signals1.55-dev libboost-system1.55-dev libboost-test1.55-dev libboost-thread1.55-dev
  libboost-timer1.55-dev libboost-wave1.55-dev libboost1.55-tools-dev libmpfrc++-dev libntl-dev
The following NEW packages will be installed:
  libboost-dev libboost1.55-dev
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/5,812 kB of archives.
After this operation, 93.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package libboost1.55-dev:armhf.
(Reading database ... 123451 files and directories currently installed.)
Preparing to unpack .../libboost1.55-dev_1.55.0+dfsg-3_armhf.deb ...
Unpacking libboost1.55-dev:armhf (1.55.0+dfsg-3) ...

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  229.020475] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.118581] Process mmcqd/0 (pid: 51, stack limit = 0xb8cb4210)

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.190314] Stack: (0xb8cb5d88 to 0xb8cb6000)

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.243054] 5d80:                   00000007 b9687680 b8cb5dc4 b8cb5da0 8043c924 8043cb34

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.342207] 5da0: b8cb5dc4 b8cb5db0 8055fb5c b8cb0150 b9687400 b9687680 b8cb5dfc b8cb5dc8

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.441361] 5dc0: 8043d588 8043c738 b8cb5dec 80441c80 b8cb5dfc b8cb5de0 80441c80 b8cb0150

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.540514] 5de0: b9687400 b8cb0258 b8cb0150 b8cb5ea4 b8cb5e14 b8cb5e00 80424c54 8043d428

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.639667] 5e00: b9687400 00000000 b8cb5e64 b8cb5e18 80425980 80424b5c 00000001 b8cb0008

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.738820] 5e20: b8eb7570 00000000 24590411 00000000 b8cb4000 60050013 b8cb5e5c b8eb7570

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.837973] 5e40: b8cb0008 b8cb014c b9687c00 b8cb0150 00000000 b8eb7570 b8cb5ed4 b8cb5e68

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  230.937127] 5e60: 80434494 804256e0 b8cb5ec4 b8cb5e78 80424f54 8005ef04 802c88a0 00000000

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.036280] 5e80: b8c71700 00000000 b9744200 00000000 b8cb0000 00000000 00000000 b8cb0008

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.135435] 5ea0: b9687c00 b8eb7570 b8cb0000 b8cb0008 b9687c00 b8eb7570 b8cb0000 b8cb0000

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.234586] 5ec0: 00000001 24590411 b8cb5f24 b8cb5ed8 80434fd8 804343dc 00000000 b8eb7570

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.333740] 5ee0: b8cb8000 b8cb4000 b8cb5f0c b8cb5ef8 802cf320 b9687400 b8cb0008 b8cb0008

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.432893] 5f00: b8cb8000 b8cb4000 00000000 24590411 00000001 b8eb7570 b8cb5f5c b8cb5f28

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.532047] 5f20: 804367c8 80434ee0 80436708 b8cb0010 00000000 b8c76340 00000000 b8cb0008

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.631200] 5f40: 80436708 00000000 00000000 00000000 b8cb5fac b8cb5f60 80042494 80436714

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.730353] 5f60: 8055fba4 00000000 b8cb5f94 b8cb0008 00000000 00000000 b8cb5f78 b8cb5f78

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.829508] 5f80: 00000000 00000000 b8cb5f88 b8cb5f88 b8c76340 800423ac 00000000 00000000

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  231.928660] 5fa0: 00000000 b8cb5fb0 8000f9f8 800423b8 00000000 00000000 00000000 00000000

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  232.027813] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  232.126966] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 5755d575 dddd3355

Message from syslogd@raspberrypi at Apr 11 08:33:51 ...
 kernel:[  233.178717] Code: e89da818 e28400fc 

ebf11884 eafffff6 (e7f001f2) 

Question

Does anyone have experience with installing this db on the pi3? Is there another database which maybe even suited better and is easier to install?

  • Requirements: [list of fairly specialized constraints] Use case: "Basically just some logs and users." -> I.e., Unless you left "masochism" out, you might want to reconsider the context and your justifications for slamming your head repeatedly against a wall at this point. I am not trying to be demeaning with that -- good luck. – goldilocks Apr 7 '16 at 19:44
  • Maybe I use it for future projects as well. I'm currently still trying to build it on the pi. I'm getting further step by step, if I succeed I will provide a tutorial. If I can't build it I may try to cross compile it and copy the built afterwards. – Andi Giga Apr 8 '16 at 13:32
  • As long as your databases stay below 2 GB, mongodb will work on a 32-bit system. I'd stick with what you know, and see if you run into the problem later. – scruss Apr 12 '16 at 14:00
1

From my experience. Swap space on a SD Card is considered as not trustworthy and it also slows down the installation process.

  • disable any boot to desktop in raspi-config, this saves valuable memory.

  • disable unnecessary autostart executions

  • do the most critical installation (for me rethinkdb) first

  • write an installation script, this makes it easier to start from a bare img if you have to start again. Also it allows you easily to change the order and retry the installation.

  • save your SD after each crucial step to an img/after the installation

I copy my installation script in here, maybe you can use it, if not the important steps can be extracted from the script. Please let me know if you need some explanation to one of the steps.

You have to set YOUR_SSID and YOUR_PASSWORD to include your Wifi. Copy this script in a new file: nano /etc/S99rc.installer and add a file with echo "start">/home/pi/installscript.status.

I started in the middle with applying this script, so no warranty that this works, maybe some adaption is necessary.

#RASPI INSTALLATION SCRIPT
set -eu #exit on any error & show bugs

Failure () {
  sudo -u pi echo rm /home/pi/installscript.status
  exit 1
  echo "FAILURE PLEASE CHECK INSTALLSCRIPT"
}

echo "PLEASE DO RASPI-CONFIG BEFORE: set boot to logged in and non desktop mode"
counter=0

while [ -f /home/pi/installscript.status ]; do
  counter=$((counter+1))

  if [ "$counter" -gt "100" ]
  then
    Failure
  fi

  status=$(< /home/pi/installscript.status)
  sudo -u pi echo "Current install step: $status"

#=================================== WIFI SETUP  && SYSTEM UPGRADE ==========================================
  if [ "$status" == "start" ] #wifi setup
  then
    chmod 755 /etc/S99rc.installer
    sed -i '/exit 0/i\/etc\/S99rc.installer' /etc/rc.local
    echo "setup autostart installer"
    printf 'network={%s\n\tssid="YOUR_SSID"%s\n\tpsk="YOUR_PASSWORD"%s\n}' >> /etc/wpa_supplicant/wpa_supplicant.conf
    echo "setup wifi"
    apt-get update
    apt-get upgrade
    'swap' > /home/pi/installscript.status
    echo "upgraded system"

#=================================== INCREASE SWAP ==========================================
  elif [ "$status" == "swap" ] #increase swap space
  then
    sed -i.bak 's/^\(CONF_SWAPFILE=\).*/\11000/' /etc/dphys-swapfile
    /etc/init.d/dphys-swapfile start
    sleep 5
    free -m
    sudo -u pi echo 'database' > /home/pi/installscript.status
    echo "increased swap"

#=================================== RETHINKDB ==========================================
  elif [ "$status" == "database" ]
  then
    apt-get install g++ protobuf-compiler libprotobuf-dev libboost-dev curl m4 wget
    cd /home/pi/Downloads
    wget https://download.rethinkdb.com/dist/rethinkdb-2.3.0.tgz
    tar vxf rethinkdb-2.3.0.tgz
    cd rethinkdb-2.3.0
    ./configure --with-system-malloc --allow-fetch
    make ALLOW_WARNINGS=1
    make install ALLOW_WARNINGS=1
    sudo -u pi echo 'swap2' > /home/pi/installscript.status
    echo "installed rethinkdb 2.3.0"

#=================================== DECREASE SWAP ==========================================
  elif [ "$status" == "swap2" ] #decrease swap space
  then
    sed -i.bak 's/^\(CONF_SWAPFILE=\).*/\1100/' /etc/dphys-swapfile
    /etc/init.d/dphys-swapfile start
    sleep 10
    free -m
    sudo -u pi echo 'autostart' > /home/pi/installscript.status
    echo "decreased swap"

#=================================== APPLY AUTOSTARTS ==========================================

  elif [ "$status" == "autostart" ]
  then
    #database
    sed -i '/exit 0/irethinkdb --http-port 8090' /etc/rc.local


    sudo -u pi echo 'delete' > /home/pi/installscript.status
    echo "added autostarts"

  elif [ "$status" == "delete" ] #clean up when the script was succesful
  then
    sudo -u pi echo rm /home/pi/installscript.status
    sed -i.bak '/bash \/etc\/S99rc.installer/d' /etc/rc.local
    echo "installations finished"
    exit 0
    reboot
  else
    Failure
  fi
done
ls -l /home/pi/installscript.status
echo "nothing to do"
exit 0

EDIT: You have to remove temporarily, the exit 0 in the comments of /etc/rc.local otherwise sed -i '/exit 0/i\/etc\/S99rc.installer' /etc/rc.local will be inserted after each exit 0. Or change the script accordingly: https://stackoverflow.com/questions/29256795/how-to-insert-a-line-before-the-first-and-last-matching-pattern-using-sed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.