英文:
How to create replica set in mongoDb new version above 6.0 in windows
问题
如何在MongoDB(Node.js)的最新版本中创建复制集。
我尝试了MongoDB文档
https://www.mongodb.com/docs/manual/tutorial/convert-standalone-to-replica-set/
我使用以下命令将实例运行为复制集:
mongod --port 27017 --replSet rs0 --dbpath="C:\data\db0"
然后在mongosh
中运行rs.initiate()
命令,但出现错误,提示找不到复制集。
英文:
how to create replication in mongoDb (node js) in latest version.
i was trying mongodb documentation
https://www.mongodb.com/docs/manual/tutorial/convert-standalone-to-replica-set/
i used this command to run instance as replication:
mongod --port 27017 --replSet rs0 --dbpath="C:\data\db0"
then in mongosh
run rs.initiate()
command and getting error as replica set not found
答案1
得分: 1
下载最新版本的mongosh,并在mongo shell中尝试运行以下命令:
rs.initiate();
rs.conf();
英文:
Download mongosh new version and in mongo shell try to run these commands
rs.initiate();
rs.conf();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论