您的位置:首页 > 其它

Hive 1.1.0 集群安装配置

2016-05-23 16:31 344 查看

Hive

使用系统

CentOS 6.5

集群环境

组件version
Hadoop2.6.0
Zookeeper3.4.6
Hive1.1.0

Hive配置

解压这里就不讲解了

进入Hive根目录

cd /home/hadoop/development/src/hive-1.1.0-cdh5.6.0/


这里主要需要配置 hive-site.xml

好像从 1.1.0 版本需要自己配置 hive-site.xml 没有默认的了。

1.hive-site.xml

<configuration>
#mysql 数据配置
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.2.251:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
#加载mysql jdbc驱动包
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>

#配置hive ui
<!--  hwi  -->
<property>
<name>hive.hwi.war.file</name>
<value>lib/hive-hwi-1.1.0-cdh5.6.0.jar</value>
<description>This sets the path to the HWI war file, relative to ${HIVE_HOME}. </description>
</property>

<property>
<name>hive.hwi.listen.host</name>
<value>0.0.0.0</value>
<description>This is the host address the Hive Web Interface will listen on</description>
</property>

<property>
<name>hive.hwi.listen.port</name>
<value>9999</value>
<description>This is the port the Hive Web Interface will listen on</description>
</property>
#配置 Hive 临时文件存储地址
<!--
<property>
<name>hive.exec.scratchdir</name>
<value>/yuqi_dir/hive/tmp/hive-${user.name}</value>
<description>Scratch space for Hive jobs</description>
</property>

<property>
<name>hive.exec.local.scratchdir</name>
<value>/yuqi_dir/hive/tmp/${user.name}</value>
<description>Local scratch space for Hive jobs</description>
</property>

<property>
<name>hive.metastore.warehouse.dir</name>
<value>/yuqi_dir/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
-->
</configuration>


>将mysql的驱动包放在 Hive根目录下的/lib目录下

mysql jdbc 驱动包

3.测试HIve

[hadoop@canbot130 hive-1.1.0-cdh5.6.0]$ hive
which: no hbase in (/home/hadoop/development/src/sqoop-1.4.6-cdh5.6.0/bin:/home/hadoop/development/src/hive-1.1.0-cdh5.6.0/bin:/home/hadoop/development/src/hadoop-2.6.0-cdh5.6.0/bin:/home/hadoop/development/src/hadoop-2.6.0-cdh5.6.0/sbin:/usr/jvm/jdk1.7.0_79/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/hadoop/development/src/zookeeper-3.4.5-cdh5.6.0/bin:/home/hadoop/bin)

Logging initialized using configuration in jar:file:/home/hadoop/development/src/hive-1.1.0-cdh5.6.0/lib/hive-common-1.1.0-cdh5.6.0.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
'hive>'


启动成功!

测试是否连接mysql数据库

就不在这里测试了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: