当前位置: 首页 > 知识库问答 >
问题:

无法在Windows上部署MongoDB副本集?

晏富
2023-03-14

我想从配置文件中部署一个mongodb副本集,该副本集包含1个主副本和2个次副本,如下所示:

主节点的第一个配置文件

#primary node
#===============
dbpath = C:\data\rs0\1
directoryperdb = true
bind_ip = 192.168.2.104
port = 27017
logpath = C:\mongodb2.5.3\logs\primary.log
logappend = true
noauth = true
replSet = rs0
rest = true
#secondary node
#===============
dbpath = C:\data\rs0\2
directoryperdb = true
bind_ip = 192.168.2.104
port = 27018
logpath = C:\mongodb2.5.3\logs\secondary1.log
logappend = true
noauth = true
replSet = rs0
rest = true
#secondary node
#===============
dbpath = C:\data\rs0\3
directoryperdb = true
bind_ip = 192.168.2.104
port = 27019
logpath = C:\mongodb2.5.3\logs\secondary2.log
logappend = true
noauth = true
replSet = rs0
rest = true
 ....
    2013-11-28T16:26:59.734+0700 [initandlisten] options: { bind_ip: "192.168.2.104", config: "config\mongorep.conf", dbpath: "C:\data\rs0\1", directoryperdb: true, logappend: true, logpath: "C:\mongodb2.5.3\logs\primary.log", noauth: true, port: 27017, replSet: "rs0", rest: true }
2013-11-28T16:26:59.742+0700 [FileAllocator] allocating new datafile C:\data\rs0\1\local\local.ns, filling with zeroes...
2013-11-28T16:26:59.742+0700 [FileAllocator] creating directory C:\data\rs0\1\local\_tmp
2013-11-28T16:26:59.835+0700 [FileAllocator] done allocating datafile C:\data\rs0\1\local\local.ns, size: 16MB,  took 0.092 secs
2013-11-28T16:26:59.836+0700 [FileAllocator] allocating new datafile C:\data\rs0\1\local\local.0, filling with zeroes...
2013-11-28T16:27:00.101+0700 [FileAllocator] done allocating datafile C:\data\rs0\1\local\local.0, size: 64MB,  took 0.265 secs
2013-11-28T16:27:00.102+0700 [initandlisten] command local.$cmd command: { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0  reslen:37 360ms
2013-11-28T16:27:00.102+0700 [initandlisten] waiting for connections on port 27017
2013-11-28T16:27:00.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
2013-11-28T16:27:00.103+0700 [rsStart] replSet info you may need to run replSetInitiate -- rs.initiate() in the shell -- if that is not already done
2013-11-28T16:27:00.104+0700 [websvr] admin web console waiting for connections on port 28017
2013-11-28T16:27:01.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
2013-11-28T16:27:02.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
2013-11-28T16:27:03.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
2013-11-28T16:27:04.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
2013-11-28T16:27:05.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)

我也得到了同样的错误

replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)

我不知道我需要做什么esle配置来解决这个问题,请帮助我,非常感谢。

共有1个答案

丁志勇
2023-03-14

在配置文件中添加/更改replset的值后,在mongo控制台中运行rs.initiate()

 类似资料:
  • 我试着在这些问题中应用所有的解决方案: 在我的web.xml中,我使用了标记'res-ref-name'。 多谢!

  • 当我试图在heroku上部署springboot应用程序时,出现了以下错误: 无法执行目标org.apache.Maven.plugins:maven-compiler-plugin:3.8.1:在项目后端编译(default-compile):错误编译:无效的目标版本:11->[Help 1]Remote:[error]Remote:[error]要查看错误的全部堆栈跟踪,请使用-e开关重新运行

  • 我正在运行AWS EC2上设置的三个远程实例副本,并为我的IP打开了端口27017和ICMP上的安全组(防火墙)。 我的开发环境是Mac OS X上带有PHP 5.6.2的MAMP。当PHP测试文件中的新MongoClient时,我提供了一个连接字符串: mongodb://52.68.25.131:27017,52.68.29.231:27017,52.68.50.99:27017/?repli

  • 问题内容: 我可以在Liunx OS上部署Twitter苍鹭群集,但是我不知道苍鹭是否可以部署在Window OS上? 此外,如果我想使用IntelliJ IDEA运行Heron项目,是否应该在Liunx OS(不是Windows OS)上安装IntelliJ IDEA。 任何建议,将不胜感激。 问题答案: 我们尚未为Heron正式支持Windows。您可以在Linux中安装群集,然后从Windo

  • 我刚刚在Windows10上重新安装了Python。我输入“python”并得到python3.7。4.我试图导入Tkinter,但它显示“没有名为‘Tkinter’的模块”。我在网上四处查看,所有信息都表明Tkinter是Python附带的标准库。如果您有任何帮助,我们将不胜感激。