There are two reasons for index replication. First, index replication improves the reliability and fault-tolerance of the search service that you build. Second, by replicating the index and having multiple Sensei nodes handle the same shards of index, you can reduce the workload every Sensei node takes and thus improve the performance of the search service.
In Sensei, failovers of replicas are achieved by ZooKeeper and the built-in load balancer implemented based on consistent hashing. If one replica is down, the load balancer will be notified by ZooKeeper, and it will update the replica information maintained internally and route new search requests to a different replica.
It is very easy to add a Sensei node to an existing Sensei
cluster and make it a replica of one or more index shards. Suppose
you want to add one replica for a Sensei node, node 2, that contains
two shards, all you need to do is copy over the config file
sensei.properties
on node 2 and change the node
ID setting (sensei.node.id
) to the node ID that
you are going to assign to the newly added node.