sensei cluster

[url]http://senseidb.github.com/sensei/cluster.html[/url]
[img]http://senseidb.github.com/sensei/images/index-sharding.png[/img]

sensei中在node上层有一个broker的概念,会拦截data-event和query request.
每个broker都会从zookeeper那里得到一份shard-id to node-id map.

在索引的时候:
broker接受到事件的时候,会使用ShardingStrategy分发事件。
sensei.sharding.strategy定义进行分发的类。

在查询的时候:
broker接受到请求,会使用LoadBalancerFactory得到LoadBalancerFactory进行分桶。把不同的请求打到不同的node.
sensei.search.router.factory配置进行分发的类。


Under the hood

Each Sensei node reports to Zookeeper, our cluster manager, its state and which shards it has. Zookeeper propagates this information through-out the entire cluster, especially to the brokers. The brokers maintains an inverse map of shard id to node id list. This list is kept up to date with cluster topology changes from newly introduced nodes and/or node failures.
Sharding Strategy

At indexing time, the ShardingStrategy is applied from the data events streamed-in from the gateway for each node. So only data-events belong to a specific shard is added. ShardingStrategy can be configured with sensei.sharding.strategy setting in the sensei.properties file.
Load Balancer Factory

At query time, the broker uses the SenseiLoadBalancerFactory to get a SenseiLoadBalancer and generates a routing map to get a list of nodes to send the requests to. By default, broker uses consistent hash on the routing parameter provided by the request. Load balancer factory can be configured with sensei.search.router.factory setting in the sensei.properties file.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值