Pinot 简介

来源:互联网 发布:linux操作系统 编辑:程序博客网 时间:2024/05/22 17:41

1. Introduction to Pinot

Pinot 是一个实时分布式的 OLAP 数据存储和分析系统。LinkedIn 使用它实现低延迟可伸缩的实时分析。Pinot 从离线数据源(包括 Hadoop 和各类文件)和在线数据源(如 Kafka)中攫取数据进行分析。Pinot 被设计是可以进行水平扩展的。

2. What is it for (and not)?

2.1 Pinot 适用于这样的应用场景

数据:不改变的、只追加的
分析:可以做的低延迟的查询

2.2 关键特性

* 列式存储数据库,支持多种压缩方式:Run Length, Fixed Bit Length
* 插件式索引技术:Sorted Index, Bitmap Index, Inverted Index
* 可根据Query和Segment元数据进行查询和执行计划的优化
* 近实时的从 Kafka 获取数据,以及批量从 Hadoop 获取数据
* 使用类SQL,支持:selection, aggregation, filtering, group by, order by, distinct, top, limit
* 支持多值字段
* 水平伸缩以及容错

2.3 Pinot 的一些局限性

* Pinot 不是一个数据库替代品——不是一个真正的数据库,不能修改数据
* Pinot 不是一个搜索引擎的替代品
* Pinot 不能做跨表的查询

3. Terminology

3.1 Table

Table 是一组关系数据集的逻辑抽象,它包含行和列(Document)。Table schema 定义了列和元数据。

3.2 Segment

一个逻辑的 Table 可以分为多个物理单元,这些单元就是 segment。

3.3 Pinot 包含的组件(角色)

* Pinot Controller:管理集群中的节点——处理 Table和 Segment 的创建、更新和删除操作,计算 Table 和 Segment 在 Pinot Server 上的分配。
* Pinot Server:保存一个或者多个物理的Segment——被分配一个预先创建的 segment,下载并且装载这个 Segment,当被分配一个 Kafka Topic,从 kafka 的partion 的一个子集中消费数据,执行查询请求并将结果返回给 PinotBroker。
*Pinot Broker:接收客户端的查询请求,并且将他们路由到多个 Server 上(根据路由策略),合并接收的查询结果并返回给客户端。

4. Quick Start

4.1 编译

$ git clone https://github.com/linkedin/pinot.git$ cd pinot$ mvn install package  -DskipTests$ cd pinot-distribution/target/pinot-0.016-pkg$ chmod +x bin/*.sh

4.2 实时模式启动

$ bin/quick-start-realtime.shStarting KafkaCreated topic "meetupRSVPEvents".Starting controller, server and brokerAdded schema and tableRealtime quick start setup completeStarting meetup data stream and publishing to kafka

4.3 通过 http://localhost:9000/query/index.html 进行查询

select count(*) from meetupRsvp
...

ref: https://github.com/linkedin/pinot/wiki


1 0