如何使用presto查询配置单元数据

时间:2013-11-13 15:19:31

标签: presto

我刚刚安装了presto,当我使用presto-cli查询hive数据时,我收到以下错误:

$ ./presto --server node6:8080 --catalog hive --schema default
presto:default> show tables;
Query 20131113_150006_00002_u8uyp failed: Table hive.information_schema.tables does not exist

config.properties是:

coordinator=true
datasources=jmx,hive
http-server.http.port=8080
presto-metastore.db.type=h2
presto-metastore.db.filename=/root/h2
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=`http://node6:8080`

hive.properties是:

connector.name=hive-cdh4
hive.metastore.uri=thrift://node6:9083

我使用的hadoop发行版是CDH 4.4。我相信它安装正确,配置单元可以自己成功处理查询。

任何人都可以帮我解决这个问题吗?任何想法将不胜感激。

3 个答案:

答案 0 :(得分:2)

根据使用入门的建议,我创建了一个控制器(仅限jmx)和一个单独的工作人员(jmx,hive),每个工作在不同的机器上。

最终为我解决的问题是将工作人员的主机名和http-server.http.port指定为--server的{​​{1}}参数。指定控制器时,它不起作用。

这一切都有道理,但我仍然想知道当我有两个Presto-Hive工作人员会发生什么......

答案 1 :(得分:0)

在etc / catalog / hive.properties中添加更多行 " hive.config.resources =的/ etc / hadoop的/ CONF /芯-site.xml中,在/ etc / hadoop的/ CONF / HDFS-site.xml中" 在做之前检查路径的值。

  

presto-metastore.db.filename =< - 这是Hive Warehouse的值   目录 ?   =>这个presto的Metastore,而不是hive。

答案 2 :(得分:0)

我刚刚弄清楚我的情况出了什么问题: 您还必须在$ HIVE_HOME / conf / hive-env.sh中添加以下行,以通知配置单元打开thrift端口(与hive-site.xml文件中的hive.metastore.uris属性中提到的相同)。 hive客户端使用此端口通过RPC连接到Metastore。

导出METASTORE_PORT = 9084

在conf文件夹中的hive-env.sh文件中。 这应该将您的配置单元与presto同步。