andrewstillie
Posts: 54
Joined: Tue Sep 18, 2012 11:26 am

Installing Mongodb

Fri Mar 11, 2016 11:43 pm

Hi there ,

I am trying to install Mongoldb on my Pi, using the mongo4pi (https://github.com/svvitale/mongo4pi).

I have listed the script below, but I get the error below when the service tries to start.

Can anyone offer some help?

Thanks
Andy


[email protected]:~/downloads/mongo4pi $ cat install.sh
#!/bin/bash
if [ $(id -u) != 0 ]; then
exec sudo -- "$0" "[email protected]"
exit
fi

echo "Creating mongodb user"
adduser --firstuid 100 --ingroup nogroup --shell /etc/false --disabled-password --gecos "" --no-create-home mongodb

echo "Installing mongo to /opt/mongo..."
tar xfz mongo.tar.gz -C /opt --owner mongodb

echo "Creating runtime directories under /var"
install -o mongodb -g nogroup -d /var/log/mongodb/
install -o mongodb -g nogroup -d /var/lib/mongodb/

echo "Installing config scripts"
install mongod /etc/init.d
install mongodb.conf /etc

echo "Setting mongod to start on boot"
update-rc.d mongod defaults
echo "Starting mongod"
/etc/init.d/mongod start

echo "done."

[email protected]:~/downloads/mongo4pi $ /etc/init.d/mongod start
[....] Starting mongod (via systemctl): mongod.serviceFailed to start mongod.service: Access denied
failed!
[email protected]:~/downloads/mongo4pi $
If I manually try to start mongo I get the following....

[email protected]:/opt/mongo/bin $ ./mongod
db level locking enabled: 1
./mongod --help for help and startup options
Fri Mar 11 23:57:59
Fri Mar 11 23:57:59 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Fri Mar 11 23:57:59
Fri Mar 11 23:57:59 Assertion failure 5 == (int)(g.distance( a , b ) ) src/mongo/db/geo/2d.cpp 3111
0x315e08 0x2015b4 0x393554 0x441d84 0x397f80 0x15c1d0 0xb6bda294
./mongod(_ZN5mongo15printStackTraceERSo+0x18) [0x315e08]
./mongod(_ZN5mongo12sayDbContextEPKc+0xc4) [0x2015b4]
./mongod(_ZN5mongo12verifyFailedEPKcS1_j+0x108) [0x393554]
./mongod(_ZN5mongo11GeoUnitTest3runEv+0x3b84) [0x441d84]
./mongod(_ZN5mongo11StartupTest8runTestsEv+0x44) [0x397f80]
./mongod(main+0x1f58) [0x15c1d0]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0xb6bda294]
Fri Mar 11 23:57:59 terminate() called, printing stack (if implemented for platform):
0x315e08 0x16f708 0xb6e1d9a0
./mongod(_ZN5mongo15printStackTraceERSo+0x18) [0x315e08]
./mongod(_ZN5mongo11myterminateEv+0x40) [0x16f708]
/usr/lib/arm-linux-gnueabihf/libstdc++.so.6(+0x4a9a0) [0xb6e1d9a0]
Fri Mar 11 23:57:59 Got signal: 6 (Aborted).

Fri Mar 11 23:57:59 Backtrace:
0x315e08 0x1703bc 0xb6bf1180 0xb6beff70
./mongod(_ZN5mongo15printStackTraceERSo+0x18) [0x315e08]
./mongod(_ZN5mongo10abruptQuitEi+0x240) [0x1703bc]
/lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0xb6bf1180]
/lib/arm-linux-gnueabihf/libc.so.6(gsignal+0x38) [0xb6beff70]

User avatar
DougieLawson
Posts: 35823
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Installing Mongodb

Sat Mar 12, 2016 9:23 am

Try using some instructions that are more up to date. That github repo you've used hasn't been updated for two years and is based on a github repo from nearly four years ago.

http://andyfelong.com/2015/12/mongodb-3 ... erry-pi-2/
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Andresvidal
Posts: 1
Joined: Tue Aug 21, 2012 4:41 am

MongoDB 3.0.14 for Raspberry Pi 3 (ARMv7l) - Docker 17.11.0-ce+

Sat Dec 30, 2017 7:37 am

If this helps, I've created a docker image for MongoDB 3.0.14 on Raspbian Stretch and tested on the Raspberrypi 3. Check it out https://github.com/andresvidal/rpi3-mongodb3 and https://hub.docker.com/r/andresvidal/rpi3-mongodb3/

Once you install Docker 17.11.0-ce+, run...

$ docker run -d \
--name rpi3-mongodb3 \
--restart unless-stopped \
-v /data/db:/data/db \
-v /data/configdb:/data/configdb \
-p 27017:27017 \
-p 28017:28017 \
andresvidal/rpi3-mongodb3:latest

Return to “Beginners”