在分片环境中,如果我的应用程序连接到 mongod 而不是 mongos,会发生什么情况?
数据应该进入一个分片还是将在各个分片之间分割?
The data should go to one shard or it will be splitted between the shards?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要那样做。 :-)
没有明确的保护措施;将来这将是一个很好的改进。通常,分片集群中的 mongod 运行在与默认端口号不同的端口号上,因此很难意外地执行此操作。
系统管理员可能希望显式连接到这样的服务器来检查它——只要操作是只读的就可以了。您还可以在那里执行管理操作,例如重新索引等。
Don't do that. :-)
There isn't explicit protection against that; in the future that would be a good improvement. Typically the mongod's in a sharded cluster are running on a different port number than the default so it is difficult to accidentally do that.
A sysadmin may wish to explicitly connect to such a server to inspect it -- that is fine as long as the operations are read only. You could also do administrative actions there such as a reindex and such.