presto整合hive

Presto安装
  前提条件: hadoop安装好了(并启动了) + hive安装好了  
     文档网址:http://prestodb.jd.com/docs/current/installation/deployment.html
  首先解压下载好的tar.gz包
    1 .安装包 https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.100/presto-server-0.100.tar.gz
        2.  客户端连接包下载: https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.100/presto-cli-0.100-executable.jar
  
  解压presto-server-0.100.tar.gz 然后进入创建etc文件夹,新建下面文件夹和文件
    
  hadoop文件夹:  hadoop的配置文件:hdfs-site.xml   core-site.xml
  node.properties:每个节点的环境配置
  jvm.config:jvm 参数
  config.properties:配置 Presto Server 参数
  log.properties:配置日志等级
  Catalog :Catalog 文件夹,下面放各个数据的配置文件比如hive.properties
 1>node.properties配置
 
node.environment=production
node.id=1
node.data-dir=/home/kevin/software/presto-server-0.100/data
 
  节点配置node.id=1
  切记:每个节点不能重复我本地把协调和生产节点部署到了一起
 2>config.properties
 
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://192.168.43.20:8080
 
 
 3>catalog /hive.properties的配置
         
  connector.name是连接器,我是apache2*版本的,所以我用hive-hadoop2
    
connector.name=hive-hadoop2
hive.metastore.uri=thrift://192.168.43.20:9083
hive.config.resources=/home/kevin/software/presto-server-0.100/etc/hadoop/core-site.xml,/home/kevin/software/presto-server-0.100/etc/hadoop/hdfs-site.xml
 
 4>jvm.config配置
 
-server
-Xmx16G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:ReservedCodeCacheSize=150M
 
 
 
  这个可以根据自己的机器配置进行相应调整
 5>log.properties配置
 
com.facebook.presto=INFO
 
 
  配置完成之后,可以运行presto服务了,如果目录权限不够,使用如下命令(我自己是kevin)
chown -R kevin:kevin /home/presto
  presto服务的启动方式有两种,第一种是start后台运行看不到日志输出 ,run前台运行,可在前台看到打印日志,建议前期使用run进行前台运行
 
 
 
 
  当出现这样的关键词时,恭喜搭建完成
  接下来可以测试一下,我们使用一个工具presto-cli-0.100-executable.jar 下载之后,重命名为presto-cli  并加上权限
    mv  presto-cli-0.100-executable.jar presto-cli
     sudo chmod +x ./presto-cli
 
  启动Hive服务(如果是后台启动,后面加上&)
 
Presto客户端连接
 ./presto-cli --server localhost:8080  --catalog hive --schema default
如上命令行,可以执行一下show tables;进行测试
posted on 2019-08-22 10:03  一只猪儿虫  阅读(6388)  评论(0编辑  收藏  举报