Hive JDBC连接设置或与MySQL的映射 [英] Hive JDBC connection setting or mapping with MySQL

查看:636
本文介绍了Hive JDBC连接设置或与MySQL的映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不熟悉大数据;从技术上讲,我是Java开发人员,因此决定学习大数据概念.我只能够安装Hadoop和Hive,现在我想将Java程序连接到Hive.我已经将MySQL配置为后端数据库.

I am new to big data; technically I am a Java developer and decided to learn big data concepts. I am just able to install Hadoop and Hive, and now I want to connect my Java program to Hive. I have configured MySQL as a back-end db.

尝试使用Google,并找到了一些Java程序示例,他们在其中使用了类似URL jdbc:hive2://172.16.149.158:10000/default,"",""的内容.

Tried to Google it and found a few Java program sample where they are using something like this URL jdbc:hive2://172.16.149.158:10000/default,"","".

我的问题是我没有在hive-sites.xml中进行任何此类设置.我应该在哪里进行这些设置,或者如果不是在哪里可以找到我应该使用的设置?

My question is I didn't made any setting like this in hive-sites.xml. Where should I made these setting or if not than where to find out which setting I should use?

推荐答案

端口10000是HiveServer2的默认端口,它使客户端能够对Hive执行查询.

Port 10000 is the default port for HiveServer2, which enables clients to execute queries against Hive.

通过属性hive.server2.thrift.port

<property>
  <name>hive.server2.thrift.port</name>
  <value>10000</value>
</property>

有关HiveServer2的更多详细信息,请此处

More details on HiveServer2 are here

此外,URL中的default是默认的Hive数据库.

Also, the default in the URL is the default Hive database.

这篇关于Hive JDBC连接设置或与MySQL的映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆