0
0 Comments

这是配置
rs.conf()
{
“_id” : “repset”,
“version” : 3,
“members” : [
{
“_id” : 0,
“host” : “ip:27030”,
“arbiterOnly” : false,
“buildIndexes” : true,
“hidden” : false,
“priority” : 1,
“tags” : {

},
“slaveDelay” : 0,
“votes” : 1
},
{
“_id” : 2,
“host” : “ip:27030”,
“arbiterOnly” : false,
“buildIndexes” : true,
“hidden” : false,
“priority” : 1,
“tags” : {

},
“slaveDelay” : 0,
“votes” : 1
},
{
“_id” : 3,
“host” : “ip:27030”,
“arbiterOnly” : false,
“buildIndexes” : true,
“hidden” : false,
“priority” : 0,
“tags” : {

},
“slaveDelay” : 3600,
“votes” : 1
}
],
“settings” : {
“chainingAllowed” : true,
“heartbeatTimeoutSecs” : 10,
“getLastErrorModes” : {

},
“getLastErrorDefaults” : {
“w” : 1,
“wtimeout” : 0
}
}
}

这是uri
mongodb://ip:27030,ip:27030/?connectTimeoutMS=300000&maxPoolSize=100&replicaSet=repset&readPreference=secondaryPreferred

连接的时候报了这个错误
pymongo.errors.ServerSelectionTimeoutError: No replica set members found yet