WebAnother way to cleanly shut down a running server is to use the shutdown command, > use admin > db.shutdownServer (); Share Improve this answer Follow answered Feb 20, 2014 at 13:24 Nanhe Kumar 15.3k 5 78 70 Add a comment 10 Open Command prompt as an administrator net stop mongodb Share Improve this answer Follow answered Oct 27, … WebMar 23, 2024 · use admin db.shutdownServer() After the command is run, all members of the replica set will be offline. Now, restart each member of the replica set with access control enabled. For each member of the replica set, start the mongod instance with either the security.keyFile configuration file setting or the --keyFile command-line option.
mongodb4.4常用命令《三》_雍州无名的技术博客_51CTO博客
WebMar 18, 2012 · To Shutdown MongoDB $ ./mongo > use admin > db.shutdownServer () server should be down... Then upgraded following these instructions: How to Install MongoDB on Ubuntu Add the 10 Gen (creators of MongoDB) public key to apt-get so you trust their package: $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 WebMar 2, 2014 · 1, mongo shell : 两步命令 a. use admin b. db.shutdownServer () 2. bash shell :任何一个都可以 echo "db.shutdownServer ()" mongo admin --port 37017 mongo admin --port 37017 --eval "db.shutdownServer ()" mongo --eval "db.getSiblingDB ('admin').shutdownServer ()" alias mongostop='mongo admin --eval … hannut facebook
node.js - how to restart mongodb in terminal? - Stack Overflow
WebFor systems with authorization enabled, users may only issue db.shutdownServer() when authenticated to the admin database or via the localhost interface on systems without authentication enabled. Use --shutdown. Supported on Linux only. From the command line, shut down the mongod using the --shutdown option: WebOnce you step down the primary and a new primary has been elected, shut down the old primary using the db.shutdownServer() method against the admin database. db. getSiblingDB ("admin"). shutdownServer Restart the mongod with the new configuration file, specifying the path to the config file using --config. WebMar 6, 2015 · db.shutdownServer() exit On the command line: rm -rf /var/lib/mongodb/* sudo service mongodb start It then takes a couple of hours to resync. Once resynced I did the following on the primary: rs.status() //To make sure that the everything was synced rs.stepDown(9200) db.shutdownServer() exit On the command line I ran: hannut educ sport