I’ve an issue with my replica shared cluster.
“Cannot accept sharding commands if sharding state has not been initialized with a shardIdentity document”.
To understand the issue in a better way, could you help with a few details for the above deployment and error you are seeing.
Could you help me with the steps to reproduce the above issue or what steps did you follow and ended up with the above error?
What is the MongoDB version for the sharding deployment? Please include the version of all mongod and mongos processes.
Is this an old or a fresh deployment ?
If this is a restored data from another deployment, I would suggest you to follow the documentation to restore a sharded cluster and let us know if you have any further questions.
Hi @Aasawari thanks for your answer and sorry for the late reply.
I finally find a solution by adding a shardIdentity document on the first replicaset (mongoshard-rs1n1) of mongoshard_rs1 group. It was missing on the admin default db of mongoshard-rs1n1.