如果我将 mongos 2.6 与 mongod 3.0 一起使用会怎样
What happens if I use mongos 2.6 with mongod 3.0
范围:
我目前正在按照官方文档提供的建议将大型 MongoDB 分片环境从 2.6 升级到 3.0:
https://docs.mongodb.com/v3.0/release-notes/3.0-upgrade/#upgrade-recommendations-and-checklists
在其中,他们用以下注释警告我们:
Do not upgrade the mongod instances until after you have upgraded all
the mongos instances.
但是,他们没有告诉我们这样做的后果是什么,更重要的是,如果发生这种情况如何恢复。
目标:
我们想测试连接到 3.0 分片环境的 mongos 2.6 并模拟其故障排除。
问题:
在继续之前(显然是在测试环境中),我想知道是否有人做过这样的测试,结果如何。另外,你是怎么恢复的。
提前致谢。
我已经尝试了上面的方法,似乎 mongod 不允许 mongos 建立连接:
mongos> show tables
2016-10-17T13:24:00.954+0100 E QUERY [thread1] Error: error: {
"$err" : "could not initialize sharding on connection mtk-uat-rs-eu0/mongod.mtkdb413.motortrak.com:28100,mongod.mtkdb413.motortrak.com:28101 :: caused by :: v3.0 mongod is incompatible with v2.6 mongos, a v2.6 mongos may be running in the v3.0 cluster at 192.168.151.28",
"code" : 15907,
"shard" : "mtk-uat-rs-eu0"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBQuery.prototype.next@src/mongo/shell/query.js:297:1
DB.prototype._getCollectionInfosSystemNamespaces@src/mongo/shell/db.js:743:27
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:789:16
DB.prototype.getCollectionNames@src/mongo/shell/db.js:796:16
shellHelper.show@src/mongo/shell/utils.js:753:9
shellHelper@src/mongo/shell/utils.js:650:15
@(shellhelp2):1:1
mongos> show tables
2016-10-17T14:20:24.223+0100 E QUERY [thread1] Error: error: {
"$err" : "could not initialize sharding on connection mtk-uat-rs-eu0/mongod.mtkdb413.motortrak.com:28100,mongod.mtkdb413.motortrak.com:28101 :: caused by :: v3.0 mongod is incompatible with v2.6 mongos, a v2.6 mongos may be running in the v3.0 cluster at 192.168.151.28",
"code" : 15907,
"shard" : "mtk-uat-rs-eu0"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBQuery.prototype.next@src/mongo/shell/query.js:297:1
DB.prototype._getCollectionInfosSystemNamespaces@src/mongo/shell/db.js:743:27
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:789:16
DB.prototype.getCollectionNames@src/mongo/shell/db.js:796:16
shellHelper.show@src/mongo/shell/utils.js:753:9
shellHelper@src/mongo/shell/utils.js:650:15
@(shellhelp2):1:1
范围:
我目前正在按照官方文档提供的建议将大型 MongoDB 分片环境从 2.6 升级到 3.0: https://docs.mongodb.com/v3.0/release-notes/3.0-upgrade/#upgrade-recommendations-and-checklists
在其中,他们用以下注释警告我们:
Do not upgrade the mongod instances until after you have upgraded all the mongos instances.
但是,他们没有告诉我们这样做的后果是什么,更重要的是,如果发生这种情况如何恢复。
目标:
我们想测试连接到 3.0 分片环境的 mongos 2.6 并模拟其故障排除。
问题:
在继续之前(显然是在测试环境中),我想知道是否有人做过这样的测试,结果如何。另外,你是怎么恢复的。
提前致谢。
我已经尝试了上面的方法,似乎 mongod 不允许 mongos 建立连接:
mongos> show tables
2016-10-17T13:24:00.954+0100 E QUERY [thread1] Error: error: {
"$err" : "could not initialize sharding on connection mtk-uat-rs-eu0/mongod.mtkdb413.motortrak.com:28100,mongod.mtkdb413.motortrak.com:28101 :: caused by :: v3.0 mongod is incompatible with v2.6 mongos, a v2.6 mongos may be running in the v3.0 cluster at 192.168.151.28",
"code" : 15907,
"shard" : "mtk-uat-rs-eu0"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBQuery.prototype.next@src/mongo/shell/query.js:297:1
DB.prototype._getCollectionInfosSystemNamespaces@src/mongo/shell/db.js:743:27
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:789:16
DB.prototype.getCollectionNames@src/mongo/shell/db.js:796:16
shellHelper.show@src/mongo/shell/utils.js:753:9
shellHelper@src/mongo/shell/utils.js:650:15
@(shellhelp2):1:1
mongos> show tables
2016-10-17T14:20:24.223+0100 E QUERY [thread1] Error: error: {
"$err" : "could not initialize sharding on connection mtk-uat-rs-eu0/mongod.mtkdb413.motortrak.com:28100,mongod.mtkdb413.motortrak.com:28101 :: caused by :: v3.0 mongod is incompatible with v2.6 mongos, a v2.6 mongos may be running in the v3.0 cluster at 192.168.151.28",
"code" : 15907,
"shard" : "mtk-uat-rs-eu0"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBQuery.prototype.next@src/mongo/shell/query.js:297:1
DB.prototype._getCollectionInfosSystemNamespaces@src/mongo/shell/db.js:743:27
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:789:16
DB.prototype.getCollectionNames@src/mongo/shell/db.js:796:16
shellHelper.show@src/mongo/shell/utils.js:753:9
shellHelper@src/mongo/shell/utils.js:650:15
@(shellhelp2):1:1