presto的安装与部署(对接kafka)
2016-01-12 23:19
686 查看
Preston Github 主页:https://github.com/facebook/presto
一 安装环境
操作系统:CenteOs 6.6JDK 版本:1.8
ps: 本测试将presto的coordinator和worker都部署在一个节点上。
二 安装Presto
2.1 下载presto(版本0.1.0.5)压缩包并解压wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.105/presto-server-0.105.tar.gz
tar -xf presto-server-0.105.tar.gz
进入plugin目录,查看支持的插件,这里主要测试kafka
2.2 配置presto
在安装目录下创建etc文件夹
2.2.1 配置node.properties
node.environment=test node.id=ffffffff-ffff-ffff-ffff-ffffffffffff node.data-dir=/var/presto/data
参数说明:
node.environment:环境名称。一个集群节点中的所有节点的名称应该保持一致。
node.id:节点唯一标识的名称。
node.data-dir:数据和日志存放路径
2.2.2 配置jvm.config
-server -Xmx4G -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p2.2.3 配置
config.properties
coordinator=true node-scheduler.include-coordinator=false http-server.http.port=8001 task.max-memory=1GB discovery-server.enabled=true discovery.uri=http://10.199.xxx.xx:8001
参数说明:
coordinator:Presto 实例是否以 coordinator 对外提供服务
node-scheduler.include-coordinator:是否允许在 coordinator 上进行调度任务
http-server.http.port:HTTP 服务的端口
task.max-memory=1GB:每一个任务(对应一个节点上的一个查询计划)所能使用的最大内存
discovery-server.enabled:是否使用 Discovery service 发现集群中的每一个节点。
discovery.uri:Discovery server 的 url
2.2.4 配置log.properties
com.facebook.presto=INFO设置某一个 java 包的日志等级
2.2.5 关于 Catalog 的配置(与kafka连接配置)
首先在etc下面建立catalog文件夹,新建kafka.properties文件,配置如下:
connector.name=kafka kafka.table-names=table1,table2 kafka.nodes=host1:port,host2:port具体配置参考http://prestodb-china.com/docs/current/connector/kafka.html
三 启动Presto
进入presto安装目录bin下面,利用help命令可以查看launcher的详细用法launcher --help以后台方式启动presto
launcher start一般启动方式,且输出并打印日志
launcher run停止presto
launcher stop
四 测试Presto CLI
下载Presto CLIwget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.100/presto-cli-0.100-executable.jar[/code]将mv presto-cli-0.100-executable.jar重命名为prestomv presto-cli-0.100-executable.jar presto将presto添加执行权限chmod 777 presto启动presto cli./presto --server localhost:8001 --catalog kafka --schema default执行show tables,如下
执行完show tables,查看 http://localhost:8001/ 页面:五 错误处理
1 server refused connection
解决方案:检查presto是否启动,一般情况为presto没有启动
2
No worker nodes available
解决方案:在config.properties中设置node-scheduler.include-coordinator=true
相关文章推荐
- 普通指针到智能指针的转换
- Linux $符号的用法
- 简述 OAuth 2.0 的运作流程
- 【Android】Fresco图片加载框架(二)————Producer
- 给jdk写注释系列之jdk1.6容器(12)-PriorityQueue源码解析
- 恶意软件流量检测系统
- 【Android】Framework概述
- jQuery学习--添加元素
- UIScrollView 介绍
- Javascript的块作用域和Java,C++的区别
- centos7 安装部署jdk环境及tomcat
- 笔记
- C和Java效率对比试验和编译器优化影响
- [Python标准库]datetime——日期和时间值管理
- Node.js_全局对象
- 推荐20个开源项目托管网站
- Cuckoo恶意软件自动化分析系统
- 如何使用springmvc的@requestbody 返回json数据
- iOS之 Auto Layout
- 自定义Log实现条件编译