- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi everyone, I've just installed MongoDB 32-bit on the Edison following this tutorial:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/ https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/
I lauched the "mongod" and it works, but now I'd like to launch mongod as a service by typing "systemctl start mongodb.service" or something like that. Unfortunately I'm still a linux newbie, I don't know how to do it :c
This is the mongod directory: /home/root/mongodb/mongodb-linux-i686-3.2.6/bin/
Please, help me!
- Tags:
- Database
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
In order to create services and manage them with systemctl as you mentioned, you need to use systemd. All the services available are located in /lib/systemd/.
In order to create a service for mongodb I suggest you to look into the following links:
http://gh0stwizard.tk/2013/09/30/mongodb-systemd/
http://tom-chapman.uk/2012/12/28/installing-mongodb-on-a-linux-distro-using-systemd-instead-of-initt...
http://askubuntu.com/questions/748789/run-mongodb-service-as-daemon-of-systemd-on-ubuntu-15-10
https://gist.github.com/chappy84/4400325
I think these links will help you to create the service. Once the service is created you need to enable it in order to run everytime at boot.
Regards,
Charlie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks for the links Charlie.
I also found this one:
https://www.freedesktop.org/software/systemd/man/systemd.service.html https://www.freedesktop.org/software/systemd/man/systemd.service.html
It explains everything about systemd.service building.
Finally I created the file:
sudo nano /etc/systemd/system/mongod.service
Then for simplicity I wrote:
[Unit]
Description=Mongo is a scalable, document-oriented database.
After=syslog.target network.target
[Service]
ExecStart=/home/root/mongodb/mongodb-linux-i686-3.2.6/bin/mongod
[Install]
WantedBy=multi-user.target
It works!! c:

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page