【问题标题】:Unable to connect specific mongo instance port无法连接特定的 mongo 实例端口
【发布时间】:2016-09-12 23:19:56
【问题描述】:

今天早上,我可以在端口 27010 和 37010 上创建 2 个不同的 mongo 实例,并且可以使用 mongo-connector 进行复制。但是现在系统重新启动后,我无法使用以下命令连接到端口 37010。

C:\Program Files\MongoDB 2.6 Standard\bin>mongo --port 37010
MongoDB shell version: 2.6.12
connecting to: 127.0.0.1:37010/test
2016-09-12T18:08:14.733-0500 warning: Failed to connect to 127.0.0.1:37010, reason: errno:10061 No connection could be made because the target machine actively refused it.
2016-09-12T18:08:14.756-0500 Error: couldn't connect to server 127.0.0.1:37010 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed

如果我只给 mongo 它只连接到默认端口 27010,它工作正常。早上我也遇到了同样的问题,我删除了我所有的 mongo windows 服务并在没有 mongo windows 服务的情况下运行。但我再次面临同样的问题。请多多指教。

下面是我的配置文件。

mongo.config.txt

##store data here
dbpath=C:\Program Files\MongoDB 2.6 Standard\data

##all output go here
logpath=C:\Program Files\MongoDB 2.6 Standard\log\mongo.log

logappend=true

#port number 
port=27017

##log read and write operations
diaglog=3

#replica set name
replSet=rs1

# only run on localhost for development
bind_ip = 127.0.0.1

mongo2.config.txt

##store data here
dbpath=C:\Program Files\MongoDB 2.6 Standard\data2

##all output go here
logpath=C:\Program Files\MongoDB 2.6 Standard\log2\mongo.log

logappend=true

#port number 
port=37017

##log read and write operations
diaglog=3

#replica set name
replSet=rs2

# only run on localhost for development
bind_ip = 127.0.0.1

【问题讨论】:

  • 嗨,大家有什么建议

标签: mongodb mongodb-query mongoid mongo-java


【解决方案1】:

按照以下博客中提到的步骤,我得到了问题的答案。

http://zdk.github.io/create-a-three-member-mongodb-replica-set

不知何故,它对我的​​配置文件不起作用。但是我通过在命令行中执行命令解决了我的问题。

【讨论】:

    猜你喜欢
    • 2021-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-18
    • 1970-01-01
    • 1970-01-01
    • 2020-04-27
    相关资源
    最近更新 更多