简体   繁体   English

错误:在copysetSet.startSet()时找不到mongodb / data / db / testReplSet-0的指定路径

[英]Error: Cannot find specified path for mongodb /data/db/testReplSet-0 when replicaSet.startSet()

Trying to get the test setup locally for mongodb replication. 尝试在本地获取用于mongodb复制的测试设置。
Steps I followed are: 我遵循的步骤是:

$ mongo --nodb
> replicaSet = new ReplSetTest({"nodes" : 3})
> // starts three mongod processes
> replicaSet.startSet()

The third step is throwing errors. 第三步是抛出错误。 I already have a existing mongo db server running at port 27017 and data of that is stored at different folder in as specified in mongod.cfg 我已经有一个现有的mongo db服务器运行在端口27017上,并且该数据存储在mongod.cfg中指定的其他文件夹中

Im trying to create a test replica set on mongod instances on different ports . 我试图在不同端口的mongod实例上创建测试副本集。 The steps shown in below image show that 3 ports where selected for replication. 下图所示的步骤显示了选择复制的3个端口。 Also I have made sure that we have a directory 我也确保我们有一个目录

/data/db 

in

{mongodbinstallation folder}\bin\

Still I get the error for path not found. 仍然我找不到路径错误。

屏幕截图

You created the db/path in the wrong place. 您在错误的位置创建了数据库/路径。 It's looking for top level /data/db and you say you created it in the bin directory of where mongodb is installed. 它正在寻找顶级/ data / db,您说是在mongodb的安装目录下的bin目录中创建的。

Since this looks like windows, create c:\\data\\db and then rerun this. 由于这看起来像Windows,因此请创建c:\\ data \\ db,然后重新运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM