Debian 8.5 - Service : command not found - mongodb

I've installed MongoDB following this (https://docs.mongodb.com/master/tutorial/install-mongodb-on-debian/?_ga=2.104926336.2025310627.1509020418-427799538.1509020418) but when trying to start MongoDB with : sudo service mongod start , i get a error indicating zsh: command not found: service

It would help to know your operating system. You may be on something
modern enough to support Systemd. In that case, the appropriate
command is something close to:
% sudo systemctl start mongodb
That works on an Arch Linux system. Yours might be called mongod or
something similar. You can just type the mongo part of it and hope
that Zsh will complete it appropriately.

Related

Can not run MongoDB using Ubuntu 14.04

I have installed mongoDB in my Ubuntu system but unable to start it.while i am running this service mongod start it throwing the following message.
start: Unknown job: mongod
Here i need to start the MongoDB. Please help me.
Looks like the mongod is not installed properly. Verify this by checking the presence of System V init script in location /etc/init.d/mongod. If not present, try installing the mongod again.

Mongodb instalation error In lubuntu

Hello everyone I am trying to configure and run MongoDB in my system but getting this error stating that the service is MASKED.
I have tried each and every possible way to solve it but not able to solve it. Please help.
I have xfce version of ubuntu(LUBUNTU) installed in my system.
Following is the error that is encountered.
Try this
sudo systemctl unmask mongodb
sudo systemctl start mongodb

How to start mongdb in Linux mint?

I would like to ask on how to start mongodb in linux mint. I tried sudo service mongod start but it shows the error mongod: unrecognized service. Why is this happen. When I run the sudo service in ubuntu Linux there is no problem like this. BUt why its not work in Linux mint? Is there a solution for this?
I just installed Mongo DB in LinuxMint Sarah (18) and for me, the following command worked:
sudo service mongodb start.
Checking that it works can be done either by executing 'top' command or checking the log file in mongodb folder (instructions in the following link ---> https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition)
For stopping mongodb, the same command but typing stop 'sudo service mongodb stop'
In the previous link, both commands are included but without the 'b', maybe they just made a typing mistake :)

Stuck in starting meteor

This is really frustrating me. I have a DO VPS with ubuntu 14.04 (64) installed.
I installed VestaCP as control panel on that and have hosted some PHP based personal project.
I also installed meteor on it but never used, now when I am trying to create a project and run it ('meteor create rt' then 'cd rt' then 'meteor')
It is giving the following error :
[[[[[ /home/admin/code/rt ]]]]]
=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
root#RD:/home/admin/code/rt#
Could anyone please help? Please ask me for more informations if required.
**** EDIT ****
I created a fresh DigitalOcean server and it is giving the same error on that. Some issue with Digital Ocean? File System of Digital Ocean? I am confused. I am trying it on different flavours of Linux and same result. All are fresh linux installations.
I finally got the solution. Posting it here for others.
This was the problem as a few environment variables which mongodb looks for while starting was not set
Set the variables LC_ALL and LANG and it works fine (mostly setting LC_ALL will do)
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
This solution is for Ubuntu 12.04 +
Other variants may require similar work.
Unexpected mongo exit code 1 is still an uncaught exception as far as i think.
You can try by updating your c/c++ compilers uptodate. Have a look here.
It says :
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.6
sudo apt-get install g++-4.6
All the best!
So we have narrowed the issue down to meteor's mongo installation on your box (though I think we were pretty sure of this all along). Let's attempt to debug that a bit. The way I have done this in the past is to try to open meteor's mongo with the mongod provided by meteor. You will perform these procedures without running the meteor server. This should give you the warning that is causing Mongo to exit. First you need to find this. In my instance installed on Mint (which should be similar to Ubuntu) it is at:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod
You can look at that location on your Ubuntu box or you can run something like this to get the location:
find ~/.meteor/ -name mongod
Once you find the location then go to the directory of your meteor project you are attempting to run and in that directory you should find this location:
<your meteor project>/.meteor/local
cd into that directory and run the following command:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod --dbpath ./
From there you can analyze the output (or update the question so we can see the output) and this should show you the mongo error you are receiving on startup and allow you to fix it.
I've got the same issues trying to start a meteor app and exactly the mongodb server is being terminated in an unexpectly manner. Generally the virtual linux server from some dealers like the one you mentioned are coming without a swap partition (check in /etc/fstab file) so if you have not enough memory to allocate MongoDB server then meteor app can't be started. You can create a swap partition or instal swapspace
sudo apt-get install swapspace
After that I was able to start the meteor app... Just be patient as swap memory is not as faster as RAM.
Since due some "smart" StackExchange policy I cannot up-vote or comment to working solution...)
Quoted answer works also on Digital Ocean on CentOS 7 x64 vmlinuz-3.10.0-123.8.1.el7.x86_64
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
I changed the locale setting to match my needs.
Fixed on my Debian 8 with the following bash command, (use sudo if needed)
localedef -i en_US -f UTF-8 en_US.UTF-8

Mongo 2.6.3 does not start on init

On fresh install of Ubuntu 14.04, I have installed mongodb 2.6.3 from mongo package,
problem is, that it does not start on reboot. It starts normally when I do
sudo service mongod start
and there are no errors in log file.
but when I reboot, log file has no new entries and
service mongod status
produces
mongod stop/waiting
I have tried mongod --repair, with no effect. I have tried fresh install of Ubuntu 14.04, as I thought that my older many times upgraded OS might have something wrong with it, but nothing changed.
With older version mongo that comes from ubuntu package manager, everything was starting up nicely.
Can you please give some advice on where to look to fix this issue and make mongod start up when system is booted up. Thanks!
Had the same problem. In the log file there was an:
************
Unclean shutdown detected
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
************
To solve this error, I just removed the lock file and it worked again.
sudo rm /var/lib/mongodb/mongod.lock
I believe the issue is that mongo upstart job checks if mongo is installed by the package manager. You need to edit the upstart job to use the new from-source binary location (which I think is /opt/mongodb/bin/mongod).