Last active
October 12, 2018 11:13
-
-
Save nickvoronin/cb0ccd763d0976a110e23e24afa0d02c to your computer and use it in GitHub Desktop.
Revisions
-
nickvoronin revised this gist
Oct 12, 2018 . 1 changed file with 27 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,30 @@ sudo rm -r /var/lib/mongodb Normally, with apt command, you can launch autoremove with all mongoDB packages : sudo apt-get autoremove mongodb-* https://askubuntu.com/questions/990727/error-removing-broken-mongo-server-package ### https://stackoverflow.com/questions/37014186/running-mongodb-on-ubuntu-16-04-lts # use sudo for all the following steps create a service script (in this example the name of the service is Mongodb) nano /lib/systemd/system/mongodb.service File content should be [Unit] Description=MongoDB Database Service Wants=network.target After=network.target [Service] ExecStart=/usr/bin/mongod --config /etc/mongod.conf ExecReload=/bin/kill -HUP $MAINPID Restart=always User=mongodb Group=mongodb StandardOutput=syslog StandardError=syslog [Install] WantedBy=multi-user.target -
nickvoronin revised this gist
Sep 1, 2018 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,12 +5,15 @@ locate -b '\mongo' # Start sudo service mongod start # Check status systemctl status mongodb.service # On start error # Failed to start mongod.service: Unit mongod.service not found. sudo systemctl unmask mongodb # Add to autorun systemctl enable mongod.service # change dbPath /etc/mongod.conf -
nickvoronin revised this gist
Aug 17, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,9 @@ which mongo locate -b '\mongo' # Start sudo service mongod start # On start error # Failed to start mongod.service: Unit mongod.service not found. sudo systemctl unmask mongodb -
nickvoronin revised this gist
Aug 17, 2018 . No changes.There are no files selected for viewing
-
nickvoronin revised this gist
Aug 17, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,10 @@ which mongo locate -b '\mongo' # On start error # Failed to start mongod.service: Unit mongod.service not found. sudo systemctl unmask mongodb # Check status systemctl status mongodb.service -
nickvoronin revised this gist
Aug 17, 2018 . 1 changed file with 14 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,25 @@ # Locate which mongo locate -b '\mongo' # Check status systemctl status mongodb.service # change dbPath /etc/mongod.conf mongod --config /etc/mongod.conf If you run ps -xa | grep mongod and you don't see a --dbpath which explicitly tells mongod to look at that parameter for the db location and you don't have a dbpath in your mongodb.conf, then the default location will be: /data/db/ and you should look there. # Remove sudo service mongod stop sudo apt-get purge mongodb-org* sudo rm -r /var/log/mongodb sudo rm -r /var/lib/mongodb # OR Normally, with apt command, you can launch autoremove with all mongoDB packages : sudo apt-get autoremove mongodb-* https://askubuntu.com/questions/990727/error-removing-broken-mongo-server-package -
nickvoronin renamed this gist
Aug 16, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nickvoronin revised this gist
Aug 16, 2018 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,12 @@ If you run ps -xa | grep mongod and you don't see a --dbpath which explicitly te parameter for the db location and you don't have a dbpath in your mongodb.conf, then the default location will be: /data/db/ and you should look there. /etc/mongod.conf mongod --config /etc/mongod.conf Normally, with apt command, you can launch autoremove with all mongoDB packages : sudo apt-get autoremove mongodb-* sudo apt-get -f install https://askubuntu.com/questions/990727/error-removing-broken-mongo-server-package -
nickvoronin revised this gist
Aug 16, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,6 @@ locate -b '\mongo' If you run ps -xa | grep mongod and you don't see a --dbpath which explicitly tells mongod to look at that parameter for the db location and you don't have a dbpath in your mongodb.conf, then the default location will be: /data/db/ and you should look there. mongod --config /etc/mongod.conf - force config -
nickvoronin created this gist
Aug 16, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ which mongo systemctl status mongodb.service locate -b '\mongo' If you run ps -xa | grep mongod and you don't see a --dbpath which explicitly tells mongod to look at that parameter for the db location and you don't have a dbpath in your mongodb.conf, then the default location will be: /data/db/ and you should look there.