1.  启动hive metastore

2. 启动hive thrift接口

参考:http://www.cnblogs.com/kisf/p/7497261.html

3. 下载presto server

wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.186/presto-server-0.186.tar.gz

 

4. 配置

config.properties

coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=20000
query.max-memory=40GB
query.max-memory-per-node=4GB
exchange.http-client.request-timeout=20s
http-server.threads.max=400
discovery-server.enabled=true
discovery.uri=http://10.183.225.158:20000

  该配置将coordinate与worker配置再一台机器上。集群部署建议分开:

etc/config.properties包含 Presto Server 相关的配置,每一个 Presto Server 可以同时作为 coordinator 和 worker 使用。你可以将他们配置在一个节点上,但是,在一个大的集群上建议分开配置以提高性能。

coordinator 的最小配置:
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri= http://xx1:9090 worker 的最小配置:
coordinator=false
http-server.http.port=
task.max-memory=1GB
discovery.uri= http://xx2:9090 可选的,作为测试,你可以在一个节点上同时配置两者:
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://xx3:9090

node.properties

node.environment=xxxoipresto01
node.data-dir=/data/slot0/presto/presto-01-coordinator
node.id=presto-01-coord

  

jvm.properties

-server
-Xmx10G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:ReservedCodeCacheSize=600M
-XX:NativeMemoryTracking=summary
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=20001
-Dcom.sun.management.jmxremote.rmi.port=20001

  

log.properties

com.facebook.presto=INFO

  

etc/catalog/hive.properties

connector.name=hive-hadoop2
hive.metastore.uri=thrift://hadoop1:9083
hive.config.resources=/xxx/soft/hadoop-2.7.3/etc/hadoop/core-site.xml,/xxx/soft/hadoop-2.7.3/etc/hadoop/hdfs-site.xml hive.metastore.authentication.type=KERBEROS
hive.metastore.service.principal=hive/hadoop1@JENKIN.COM
hive.metastore.client.principal=presto@JENKIN.COM
hive.metastore.client.keytab=/etc/presto/presto.keytab hive.hdfs.authentication.type=KERBEROS
hive.hdfs.impersonation.enabled=false
hive.hdfs.presto.principal=presto@JENKIN.COM
hive.hdfs.presto.keytab=/etc/presto/presto.keytab

  

 

4. 启动presto coordinate

/usr/bin/nohup /xxx/soft/lesports-presto-server-0.176/bin/launcher run --node-config /etc/presto/01/node.properties --jvm-config /etc/presto/01/jvm.config --config /etc/presto/01/config.properties --log-levels-file /etc/presto/01/log.properties >/xxx/soft/lesports-presto-server-0.176/stdout.log 2>&1 &

  这里为了做集群隔离把配置文件放到了另外的目录。

启动是否成功看日志,或者http://10.183.225.158:20000/看管理界面,或者:

netstat -nlp | grep 20000

  

5. 下载presto-cli

wget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.186/presto-cli-0.186-executable.jar

  

6. 改名为presto-cli

mv presto-cli-0.186-executable.jar presto-cli

  

7. 启动

./presto-cli --server hadoop1:20000 --catalog hive --schema jenkindb

  10.183.225.158的hostname为hadoop1

8. 查询

presto:jenkindb> show tables;
Table
----------
jenkintb
test1
(2 rows) Query 20171020_023712_00002_a78ua, FINISHED, 1 node
Splits: 18 total, 18 done (100.00%)
0:01 [2 rows, 49B] [2 rows/s, 51B/s] presto:jenkindb> select * from jenkintb;
id | name
----+----------
1 | jenkin
2 | jenkin.k
3 | anne
(3 rows) Query 20171020_023724_00003_a78ua, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
0:00 [3 rows, 27B] [8 rows/s, 72B/s]

  

hive导入数据参考:http://www.cnblogs.com/kisf/p/7497261.html

问题解决:

问题:failed: No worker nodes available 

解决:presto coordinate config.properties增加 node-scheduler.include-coordinator=true

问题:org.apache.hadoop.ipc.RemoteException: User: presto@JENKIN.COM is not allowed to impersonate root

解决:hive.properties增加 hive.hdfs.impersonation.enabled=false

presto-cli通过hive查询hdfs的更多相关文章

  1. cdh5.7 做完HA后hive 查询出现异常: expected: hdfs://nameservice

    异常信息如下: select * from b_pt_pr_customer_address_info limit 19; FAILED: SemanticException Unable to de ...

  2. 使用shell+awk完成Hive查询结果格式化输出

    好久不写,一方面是工作原因,有些东西没发直接发,另外的也是习惯给丢了,内因所致.今天是个好日子,走起! btw,实际上这种格式化输出应该不只限于某一种需求,差不多是通用的. 需求: --基本的:当前H ...

  3. hive查询遇到java.io.EOFException: Unexpected end of input stream错误

    hive查询遇到java.io.EOFException: Unexpected end of input stream错误 原因基本上有两个: 空文件 不完整的文件 解决办法: 删除对应文件- 参考 ...

  4. hive查询ncdc天气数据

    使用hive查询ncdc天气数据 在hive中将ncdc天气数据导入,然后执行查询shell,可以让hive自动生成mapredjob,快速去的想要的数据结果. 1. 在hive中创建ncdc表,这个 ...

  5. hive 报错/tmp/hive on HDFS should be writable. Current permissions are: rwx--x--x

    启动hive时报例如以下错误:/tmp/hive on HDFS should be writable. Current permissions are: rwx--x--x 这是/tmp/hive文 ...

  6. hive查询不加分区的一个异常

    今天下午有同事反馈她提交了了一个SQL后,hive 查询就停止响应了. 我看了下,发现hiveserver确实hug住了.听过查看日志,发现了一个牛逼的SQL, 这个SQL很简单: select a. ...

  7. hive查询语句入门(hive DDL)

    hive DDL 启动hadoop /apps/hadoop/sbin/start-all.sh 开启MySQL库,用于存放hive的元数据 sudo service mysql start 启动hi ...

  8. 求解:为什么impala实现hive查询 可以使用ifnull()函数,不可以使用length() 函数

    求大神解惑,找了很久都没有找到为什么??? hive支持length() 函数,不支持ifnull()函数??? impala实现hive查询 支持ifnull()函数,不支持length()  函数 ...

  9. hive查询结果输出到hdfs上

    insert overwrite directory "/mapredOutput/UserYesterdayInterest/${hiveconf:day}"row format ...

随机推荐

  1. intellij idea 2018注册码|intellij idea 2018破解文件下载(附破解教程/汉化包)

    intellij idea 2018破解文件http://www.3322.cc/soft/37661.html intellij idea 2018注册码是一款针对“intellij idea 20 ...

  2. MySql学习—— 查询性能优化 深入理解MySql如何执行查询

    本篇深入了解查询优化和服务器的内部机制,了解MySql如何执行特定查询,从中也可以知道如何更改查询执行计划,当我们深入理解MySql如何真正地执行查询,明白高效和低效的真正含义,在实际应用中就能扬长避 ...

  3. <a>标签实现链接和锚点的区别

    如果是实现链接,a标签中必须有href属性,并且属性值是合法的url 如果实现锚点,a标签中必须有name属性,当点击该标签时,会跳转到id同该标签的name值相同的元素处.

  4. PHP中new static()与new self()的区别异同

    self - 就是这个类,是代码段里面的这个类. static - PHP 5.3加进来的只得是当前这个类,有点像$this的意思,从堆内存中提取出来,访问的是当前实例化的那个类,那么 static ...

  5. 代码片段,Lucene的高亮显示

    代码高亮显示是通过在搜索到的Term中把匹配了用户输入的关键字的周围加上一些标记来实现(比如,关键字是 "中华" 查到的一个Term是 "中华人民共和国",则把 ...

  6. spring mvc的@Transactional注解

    转自:https://www.cnblogs.com/yepei/p/4716112.html spring的@Transactional注解详细用法   概述 事务管理对于企业应用来说是至关重要的, ...

  7. 查看、关闭登录到linux的终端

    基本概念: tty(终端设备的统称):tty一词源于Teletypes,原来指的是电传打字机,是通过串行线用打印机键盘阅读和发送信息的东西,后来这东西被键盘和显示器取代,所以现在叫终端比较合适.终端是 ...

  8. EF的使用(DbContext对象的共用问题)

    1.问题的引入 对于某一个数据库的EF操作对象,当执行某一次请求的时候,可能会多次操作数据库,也就是可能创建很多MyDbContext(继承自DbContext对象,EF上下文对象) 2.代码创建 当 ...

  9. pta习题集5-16 地下迷宫探索

    地道战是在抗日战争时期,在华北平原上抗日军民利用地道打击日本侵略者的作战方式.地道网是房连房.街连街.村连村的地下工事,如下图所示. 我们在回顾前辈们艰苦卓绝的战争生活的同时,真心钦佩他们的聪明才智. ...

  10. Oracle管理监控之使用utl_mail自动邮件报警配置

    --代发邮件存储过程源码如下: CREATE OR REPLACE PROCEDURE send_mail(p_recipient VARCHAR2, -- 邮件接收人                 ...