首页 文章

Solrcloud在幕后编写操作

提问于
浏览
1

我想详细了解SolrCloud的写操作,并对架构有一些问题:

  • Zookeeper是否向所有领导者发送文档写入请求?

solrwikiEach 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 Wikidocument 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

    这是我的理解

    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)写操作被认为是成功的如下

    事务日志对于Solr4的数据保证是不可或缺的,也是人们遇到麻烦的地方,所以让我们来谈谈它们 . SolrCloud中的索引流程如下:传入的文档由节点接收并转发给适当的领导者 . 从领导者那里,他们被送到相关碎片的所有复制品 . 复制品回应他们的领导者 . 领导者响应始发节点 . 在所有领导者都做出响应后,始发节点会回复客户端 . 此时,所有文档都已刷新到集群中所有节点的tlog!

    https://lucidworks.com/2013/08/23/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/

    我希望有所帮助

相关问题