why can't I use IP address of locally running mongod server to add it to mongodb replication set

前端 未结 2 1161
情话喂你
情话喂你 2021-01-21 02:41

I am having 3 mongod servers running locally on different ports as with below command

mongod.exe --port 27017 --replSet rs0 --dbpath C:\\data\\db1 --smallfiles -         


        
2条回答
  •  死守一世寂寞
    2021-01-21 02:53

    I had the same problem. After rs.initiate() look at the me field in printed result of this command. It's the name of your computer. For me it was Apollo-17:27001 . Having this information add other 2 servers: >rs.add("Apollo-17:27002") etc. Ensure that everything is ok: in console you will see { "ok" : 1 } . That's all.

提交回复
热议问题