Details
-
Improvement
-
Status: Backlog
-
Minor - P4
-
Resolution: Unresolved
-
None
-
None
-
Sharding NYC
-
(copied to CRM)
Description
Overview:
When `mongoS` is launched with an incorrect replica set name for the config server host, there is no clear indication of the error in customer actions.
The displayed error is:
"Cannot accept sharding commands if not started with --shardsvr" |
Encountered in version: 4.4.3
Scenario:
1. Start data nodes as:
mongod --replSet shard01 --dbpath <paths> --logpath <logbaths> --port <ports> --fork --shardsvr
|
2. Start config nodes as:
mongod --replSet configRepl --dbpath <path> --logpath <logpath> --port <conf_port> --fork --configsvr
|
3. Start `mongoS` as:
mongos --logpath <logpath> --port <port> --configdb shard01/<conf_host>:<conf_port> --fork
|
The --configdb option in this command uses the incorrect replica set name "shard01" instead of "configRepl".
4. Connect to mongoS
5. Run commands:
sh.enableSharding("myNewDB") |
use myNewDB
|
db.myNewCollection1.insertOne( { x: 1 } |
Result:
Error that suggests the server was started without the required configuration.
WriteError({
|
"index": 0, |
"code": 193, |
"errmsg": "Cannot accept sharding commands if not started with --shardsvr", |
"op": { |
"_id": ObjectId("601804bf64ac35a70d27f863"), |
"x": 1 |
}
|
})
|
Expected Result:
An indicative error that specifies that the config server <fill configDB param> is not available.