1.下载
源码:
1
2git clone https://github.com/prestodb/presto.git mvn clean install -DskipTests
在Windows环境下编译报错未解决
在Linux环境下编译成功
2.安装
这里安装使用的不是自己编译的,而是安装官网文档操作,并下载的安装包。
注意:需要jdk版本 java 8 u92+,否则会报错
2.1 下载安装包
下载地址:https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.184/presto-server-0.184.tar.gz
CLI下载地址:https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.184/presto-cli-0.184-executable.jar
2.2 解压
服务端
1
2tar xvf presto-server-0.184.tar.gz
CLI
1
2mv presto-cli-0.184-executable.jar presto chmod +x presto
2.3 配置文件
在presto-server根目录,新建etc文件夹
1
2mkdir etc
新建节点配置etc/node.properties,添加如下内容
1
2
3
4node.environment=production node.id=ffffffff-ffff-ffff-ffff-ffffffffffff node.data-dir=/var/presto/data
新建jvm配置 etc/jvm.config,添加如下内容
1
2
3
4
5
6
7
8
9-server -Xmx16G -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+CMSClassUnloadingEnabled -XX:+AggressiveOpts -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p -XX:ReservedCodeCacheSize=150M
新建配置文件 etc/config.properties,内容如下
1
2
3
4
5
6coordinator=true node-scheduler.include-coordinator=true http-server.http.port=8080 task.max-memory=1GB discovery-server.enabled=true discovery.uri=http://jiumei:8080
新建文件 etc/log.properties,内容如下
1
2com.facebook.presto=INFO
3. 启动和停止
启动
1bin/launcher start
停止
1bin/launcher stop
4.测试连接hive
新建hive配置文件 etc/catalog/hive.properties,内容如下
1
2connector.name=hive-hadoop2 hive.metastore.uri=thrift://master:9083
测试
1
2./presto --server localhost:8080 --catalog hive --schema default
5.在Metabase中配置presto
Metabase支持的数据库中没有hive,但是在很多大数据分析场景下,数据存储是在hive中的。发现Metabase是支持Presto的,而Presto是支持Hive的,所以这里通过Presto连接Hive,再用Metabase访问Presto,就可以操作Hive的数据了。
配置连接信息,查看hive中的表。
最后
以上就是火星上摩托最近收集整理的关于Presto编译安装和测试连接Hive的全部内容,更多相关Presto编译安装和测试连接Hive内容请搜索靠谱客的其他文章。
发表评论 取消回复