1.mongodb 配置文件添加replication:replSetName: rsbak2.重启mongodb3.然后进入mongo 执行 rs.initiate()将独立版转换为副本集 — MongoDB 手册重启站点