Pinot安装并简单部署测试环境

1. 下载代码

$ git clone https://github.com/linkedin/pinot.git

2. 编译pinot

$ cd pinot
$ mvn install package -DskipTests

3. 部署并启动

$ cd pinot-distribution/target/pinot-0.016-pkg
$ nohup ./bin/quick-start-offline.sh &

4. 创建schema

$ ./bin/pinot-admin.sh AddSchema -schemaFile cjf_sample/flights-schema.json

5. 创建table

$ ./bin/pinot-admin.sh AddTable -filePath ./cjf_sample/flights-definition.json

6. 生成随机数据

$ ./bin/pinot-admin.sh GenerateData -numRecords 1000000 -numFiles 1 -outDir ./flights_outdir -schemaFile ./cjf_sampleflights-schema.json

7. 生成segment

$ ./bin/pinot-admin.sh CreateSegment -format AVRO -dataDir ./flights_outdir -tableName flights -segmentName flights_seg1 -schemaFile ./cjf_sample/flights-schema.json -outDir ./flights_seg1_outdir

8. 上传segment

$ ./bin/pinot-admin.sh UploadSegment -segmentDir ./flights_seg1_outdir

9. 查询表数据

有多种方式访问pinot,可以通过web访问(http://localhost:9000/query/index.html),也可以通过API访问,这里通过curl访问:

$ curl -X POST -d '{"pql":"select count(*) from flights"}' http://localhost:8099/query


附录1:flights-schema.json

{
  "dimensionFieldSpecs" : [
    {
      "name": "Year",
      "dataType" : "INT",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name": "Month",
      "dataType" : "INT",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name": "Carrier",
      "dataType" : "STRING",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name": "Origin",
      "dataType" : "STRING",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name": "Dest",
      "dataType" : "STRING",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name": "DivAirports",
      "dataType" : "STRING",
      "delimiter" : null,
      "singleValueField" : false
    }
  ],
  "timeFieldSpec" : {
    "incomingGranularitySpec" : {
      "timeType" : "DAYS",
      "dataType" : "INT",
      "name" : "DaysSinceEpoch"
    }
  },
  "metricFieldSpecs" : [
    {
      "name" : "Delayed",
      "dataType" : "INT",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name" : "Cancelled",
      "dataType" : "INT",
      "delimiter" : null,
      "singleValueField" : true
    },
    {
      "name" : "Diverted",
      "dataType" : "INT",
      "delimiter" : null,
      "singleValueField" : true
    }
   ],
  "schemaName" : "flights"
}

附录2:flights-definition.json

{
    "tableName":"flights",
    "segmentsConfig" : {
        "retentionTimeUnit":"DAYS",
        "retentionTimeValue":"700000",
        "segmentPushFrequency":"daily",
        "segmentPushType":"APPEND",
        "replication" : "3",
        "schemaName" : "flights",
        "timeColumnName" : "daysSinceEpoch",
        "timeType" : "DAYS",
        "segmentAssignmentStrategy" : "BalanceNumSegmentAssignmentStrategy"
    },
    "tenants" : {
        "broker":"brokerOne",
        "server":"serverOne"
    },
    "tableIndexConfig" : {
        "invertedIndexColumns" : ["Carrier"],
        "loadMode"  : "HEAP",
        "lazyLoad"  : "false"
    },
    "tableType":"OFFLINE",
    "metadata": {}
}



参考文档:
Pinot 官方wiki: https://github.com/linkedin/pinot/wiki
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一些Java开源的数据中台项目: 1. Apache Druid:Apache Druid是一个高性能、实时分析的列式存储数据库。它可以用于快速查询和分析大规模的实时和历史数据。 2. Apache Flink:Apache Flink是一个分布式流处理和批处理框架。它提供了高吞吐量、低延迟的数据处理能力,并支持事件时间处理和状态管理。 3. Apache Kafka:Apache Kafka是一个分布式流处理平台,用于构建实时数据管道和流式应用程序。它具有高吞吐量、可扩展性和容错性。 4. Apache Nifi:Apache Nifi是一个易于使用、可扩展的数据集成和数据流管理工具。它可以帮助用户从各种来源收集、处理和分发数据。 5. Apache Pinot:Apache Pinot是一个实时分析的列式存储数据库。它专注于快速查询和分析大规模的实时数据,并提供了高可用性和可扩展性。 6. Presto:Presto是一个分布式SQL查询引擎,用于快速查询大规模的数据。它支持多种数据源,并具有高性能和低延迟的特点。 7. Apache Hudi:Apache Hudi是一个用于处理大规模数据的开源库。它提供了数据增量更新、删除和快照查询的能力,并支持多种数据格式。 8. Apache Iceberg:Apache Iceberg是一个开源的表格格式,用于存储大规模数据。它提供了事务性写入、快照查询和时间旅行等功能。 9. Apache Beam:Apache Beam是一个用于批处理和流处理的统一编程模型。它可以在多个执行引擎上运行,并支持多种数据处理模式。 10. Apache Kylin:Apache Kylin是一个分布式分析引擎,用于快速查询大规模的数据集。它支持OLAP和多维分析,并提供了高性能的查询能力。 这些项目都是开源的,可以根据具体需求选择适合的项目进行使用和定制化开发。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值