Raspberry pie: How to Solve Mongodb installation error

Mongodb windscreens windscreens windscreens windscreens windscreens

adduser –firstuid 100 –ingroup nogroup –shell /etc/false –disabled-password –gecos "" –no-create-home mongodb
cp -R mongodb-rpi/mongo /opt
chmod +x /opt/mongo/bin/*
mkdir /var/log/mongodb
chown mongodb:nogroup /var/log/mongodb
mkdir /var/lib/mongodb
chown mongodb:nogroup /var/lib/mongodb
cp mongodb-rpi/debian/init.d /etc/init.d/mongod
cp mongodb-rpi/debian/mongodb.conf /etc/
ln -s /opt/mongo/bin/mongod /usr/bin/mongod
chmod u+x /etc/init.d/mongod
update-rc.d mongod defaults
/etc/init.d/mongod start

Common commands:

startup
sudo service mongodb start

chack the status
sudo service mongodb status

stop
sudo service mongodb stop

error and solution:

mongod.service – LSB: An object/document-oriented database
Loaded: loaded (/etc/init.d/mongod)
Active: active (exited) since 二 2017-07-18 19:17:07 CST; 1 day 21h ago
Process: 444 ExecStart=/etc/init.d/mongod start (code=exited, status=0/SUCCESS)

 

7月 18 19:17:05 raspberrypi systemd[1]: Starting LSB: An object/document-oriented database…
7月 18 19:17:07 raspberrypi mongod[444]: Starting database: mongodb.
7月 18 19:17:07 raspberrypi systemd[1]: Started LSB: An object/document-oriented database.
7月 19 09:31:42 raspberrypi systemd[1]: Started LSB: An object/document-oriented database.
7月 20 16:20:54 raspberrypi systemd[1]: Started LSB: An object/document-oriented database.

7月 20 16:22:34 raspberrypi mongod[4625]: Starting database: mongodb failed!
7月 20 16:22:34 raspberrypi systemd[1]: mongod.service: control process exited, code=exited
7月 20 16:22:34 raspberrypi systemd[1]: Failed to start LSB: An object/document-oriented dat

Solution:

cd /var/lib
sudo rm -rf ./mongodb
sudo mkdir mongodb
sudo chown -R mongodb mongodb/
sudo service mongod restart

Similar Posts: