Pinot安装并简单部署测试环境
2015-07-30 14:17
1171 查看
1. 下载代码
$ git clone https://github.com/linkedin/pinot.git[/code]
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 ***RO -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[/code]
附录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
相关文章推荐
- ios下 active 演示激活
- Android开发学习笔记:WebView 一
- Android procrank , showmap 内存分析
- RHEL十七(计划将来的Linux任务)
- mac 安装homebrew
- 结合"hello world"探讨gcc编译程序的过程
- hdu 4324 Triangle LOVE 拓扑排序
- Xcode6及以上版本,创建Auto Layout 约束时产生的一些变化
- 实用CMD命令
- 开发运行hadoop的AvgScore程序
- 输入年月日时分秒,要求输出该年月日时分秒的下一秒,如果输出2004年12月31日59分59秒,输出2005年1月1日0时0分0秒
- 时屏蔽ios和android下点击元素时出现的阴影
- hdu 4324 Triangle LOVE 拓扑排序
- 神一般的链家自宫后就能飞吗?
- android自动接通电话:部分手机不支持
- 15. PHP 全局变量 - 超全局变量
- 技术知识图
- 妙用AlertActivity的mAlertParams 和 mAlert
- 吸血鬼数字,Java编程思想第四章练习10
- jvm笔记