前端三个route: mongos1 mongos2 mongs3
中间三个config: config1 config 2 config 3
后端三个replset: rs1,rs2,rs3
rs1三个节点:rs1_1 rs1_2 rs1_3
rs2三个节点:rs2_1 rs2_2 rs2_3
rs2三个节点:rs3_1 rs3_2 rs3_3
一个sharding后的collection比如test.users,读取它会从rs1.rs2.rs3中在secondary中读取吗?
看你的数据库连接参数了。
MongoReplicaSetClient:
• PRIMARY: Queries are sent to the primary of the replica set.
• PRIMARY_PREFERRED: Queries are sent to the primary if available, otherwise a secondary.
• SECONDARY: Queries are distributed among secondaries. An error is raised if no secondaries are available.
• SECONDARY_PREFERRED: Queries are distributed among secondaries, or the primary if no secondary is available.
• NEAREST: Queries are distributed among all members.
我觉得即使是分片,对于一个特定的复制集,这些参数应该还是有效的
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。