How to stop MongoDB Server running on Ubuntu

Stop MongoDB Server Ubuntu

The most cleanest way to shutdown MongoDB is by executing the below commands,

> use admin
> db.shutdownServer();
> use admin
switched to db admin
> db.shutdownServer();
server should be down...

You can also stop MongoDB mongod service running on Ubuntu, run the command sudo service mongod stop

# sudo service mongod stop


# sudo service mongodb stop

 * Stopping database mongodb   [OK]

You can also check the status of the server using the command,

# sudo service mongodb status
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap