![mongodb service start failed mongodb service start failed](https://i.stack.imgur.com/NnXLr.png)
Mongodb service start failed install#
I managed to break it by uninstalling 3.0.15, trying and failing to install 5.* due to ubuntu 16 not being able to run it since some dependencies clashed, then re-installing 3.0.15 again.I've installed mongodb in Debian Squeeze using this guide ( guide here) You should check that /etc/nf is actually the location of your conf file, it may be /etc/nf instead.Īs for how your service file may have gone missing in the first place. # Copy and paste text to go into service file from snippet below horizontal ruleĭescription=An object/document-oriented databaseĮxecStart=/usr/bin/mongod -quiet -config /etc/nf Re-installing wasn't creating it either for some reason. None of the 30+ existing answers helped me, because my service file was actually missing, not masked or disabled. Īnd after doing this its all working for me :D Installing new version of config file /etc/nf. Processing triggers for systemd (237-3ubuntu10.3). Processing triggers for ureadahead (0.100.0-20). Invoke-rc.d: initscript mongod, action "stop" failed.ĭpkg: warning: old mongodb-org-server package pre-removal script subprocess returned error exit status 5ĭpkg: trying script from the new package instead. įailed to stop rvice: Unit rvice not loaded. 379306 files and directories currently installed.) Get:1 bionic/mongodb-org/4.0/multiverse amd64 mongodb-org-server amd64 4.0.3 Sudo apt-get install -y mongodb-org=target_version mongodb-org-server=target_version mongodb-org-shell=target_version mongodb-org-mongos=target_version mongodb-org-tools=target_version $ sudo apt-get install -y mongodb-org=4.0.3 mongodb-org-server=4.0.3 mongodb-org-shell=4.0.3 mongodb-org-mongos=4.0.3 mongodb-org-tools=4.0.3ġ to upgrade, 4 to newly install, 0 to remove and 45 not to upgrade.Īfter this operation, 217 MB of additional disk space will be used. So make sure you dont have mongodb-org-server already installed, if yes, then make sure you uupdate it to your target version (as indicated -> Step 4 - Install a specific release of MongoDB.) The db version was 2.6.12 instead of the latest one 4.0.3. Processing triggers for man-db (2.8.3-2ubuntu0.1). Selecting previously unselected package mongodb-org-tools. Selecting previously unselected package mongodb-org-mongos. 379307 files and directories currently installed.) Selecting previously unselected package mongodb-org-shell. Mongodb-org mongodb-org-mongos mongodb-org-shell mongodb-org-toolsĠ to upgrade, 4 to newly install, 0 to remove and 46 not to upgrade.Īfter this operation, 178 MB of additional disk space will be used. The following NEW packages will be installed Mongodb-org-mongos mongodb-org-shell mongodb-org-tools The following additional packages will be installed: Then noticed that wher I run: $ sudo apt-get install -y mongodb-org I firstly installed using: sudo apt-get install -y mongodb-org I followed the instructions from but keep getting the error Failed to start rvice: Unit rvice not found I got the same error for a long while, tried almost all installation isntruciton on google but could not find te answer. Now I unselect the mongodb option and then clean. So, we need to create them and change their ownership.Įdit: I was using Stacer's cleaning tool before every shutdown. When we shutdown/reboot, one or both of them gets removed.
Mongodb service start failed code#
Put below code in the file you just opened in Step 1 #!/bin/bashĪfter the next boot you can normally start the mongod server by: sudo systemctl start mongodĮxplanation: mongodb requires the above two folders with owner as mongodb. Make a file in the /etc/init.d directory sudo gedit /etc/init.d/custom-mongo-fix.sh Permanent solution (shell script at startup) If this problem occurs again (as with me every time I reboot), make it as a shell script to be run at startup. Sudo chown -R mongodb:mongodb /var/log/mongodbĪfter running the above commands open a new terminal and run: sudo systemctl restart mongod
![mongodb service start failed mongodb service start failed](https://www.solutionanalysts.com/wp-content/uploads/2021/02/mongodb.jpg)
Sudo chown -R mongodb:mongodb /var/lib/mongodb What worked for me is sudo mkdir /var/lib/mongodb Worked fine after the install this problem occurred after I rebooted.