Discussion:
[mongodb-dev] What happens when one node of a sharded cluster is not started as sharded?
Greg Harabedian
2018-02-17 00:02:45 UTC
Permalink
We just upgraded our 3 node (9 nodes total) sharded cluster from 3.2.to
3.4. We noticed after the upgrade that when we connected (via mongos) that
if we did a "show dbs" command that we would get an error back saying we
couldn't execute commands that require a sharded cluster if the cluster is
not sharded. After poking around, we realized that one of the mongod nodes
wasn't started with the "--shardsrv" option. Other than the "show dbs"
error, everything seemed to be working normally. We could create
collections that are sharded (no errors), etc. I'm just wondering what the
actual impact would be of something like this? What would happen to data if
one of the nodes were not started as a sharded node?
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/e934c907-98c4-45e6-914e-7613ba77486e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Kaloian Manassiev' via mongodb-dev
2018-04-20 14:26:37 UTC
Permalink
Hi Greg,

Apologies for the delayed response.

To give you a bit of context: up to and including version 3.4, the
"--shardsvr" option was not mandatory and shard node's state would get
initialized as "sharding-aware" the first time it sees a connection from
another shard node (mongos, config server or another shard). Starting in
version 3.4 we made this "sharding-aware" state persistent across node
restarts so the next time a node starts and it is missing the "--shardsvr"
parameter it will fail to start, otherwise it will auto-initialize itself
as a "shard".

Now to your question - in 3.4 if a node is not started as "--shardsvr",
nothing bad should happen since the node will become initialized the first
time another node connects to it.

What is the "show dbs" error that you are getting? This might be an
indication of a bug where we perform checking somewhere based on the
startup parameters instead of the "sharding-awareness".

Best regards,
-Kal.
Post by Greg Harabedian
We just upgraded our 3 node (9 nodes total) sharded cluster from 3.2.to
3.4. We noticed after the upgrade that when we connected (via mongos) that
if we did a "show dbs" command that we would get an error back saying we
couldn't execute commands that require a sharded cluster if the cluster is
not sharded. After poking around, we realized that one of the mongod nodes
wasn't started with the "--shardsrv" option. Other than the "show dbs"
error, everything seemed to be working normally. We could create
collections that are sharded (no errors), etc. I'm just wondering what the
actual impact would be of something like this? What would happen to data if
one of the nodes were not started as a sharded node?
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/9bbaa736-49f5-4790-8da1-067cc3b763fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...