我想详细了解SolrCloud的写操作,并对架构有一些问题:
- Zookeeper是否向所有领导者发送文档写入请求?
solrwiki: Each shard can exist in multiple copies; these copies of the same shard are called replicas. One of the replicas within a shard is the leader, designated by a leader-election process.
- Cloud 有领导者和副本,所以所有领导者在索引文档之前都会运行下面描述的散列过程,或者是负责该文档的特定领导者?
Solr Wiki: document ID is used to calculate the hash Solr uses to determine the shard a document is sent to for indexing.
-
如果文档索引由于某种原因(领导者关闭)失败,那么slave节点是否尝试重新索引该文档或什么是故障转移机制?
-
仅当分片中的所有副本成功为文档编制索引时,才认为写入操作已完成 . true or false ?
1 回答
这是我的理解
1)ZooKeeper不会向SolrCloud写入任何文档 . ZooKeeper是每个SolrCloud节点用于存储共享配置并跟踪每个节点的共享状态以帮助选择领导者和监视副本状态的资源 . ZooKeeper不参与任何集合或任何更新的查询 . 另见https://stackoverflow.com/a/19628852/277023
2)至少对于SolrJ客户端,选择将节点写入哪个分片是由客户端而不是由领导者完成的,请参阅here并查看https://lucene.apache.org/solr/guide/7_0/shards-and-indexing-data-in-solrcloud.html以获取更多详细信息
3)我不知道这个问题的答案
4)写操作被认为是成功的如下
从
https://lucidworks.com/2013/08/23/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/
我希望有所帮助