How to convert a MongoDB replica set to a stand alone server

后端 未结 5 1858
我寻月下人不归
我寻月下人不归 2020-12-14 06:38

Consider, I have 4 replicate sets and the config is as follows:

{
 \"_id\": \"rs_0\",
 \"version\": 5,
 \"members\" : [
  {\"_id\": 1, \"host\": \"127.0.0.1:         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-14 07:13

    On an Ubuntu Machine

    1. Stop your mongo server
    2. open /etc/mongod.conf
    3. Comment the replication and replSetName line
    #replication:
       #replSetName: rs0
    
    1. Start your mongo server and go to mongo shell
    2. drop local database

    use local
    
    db.dropDatabase()
    
    1. Restart mongo

提交回复
热议问题