一木张、安裝
下載后解壓众辨,配置很簡(jiǎn)單,底層是MR程序舷礼,所以只需要設(shè)置一下環(huán)境變量就可以使用了鹃彻。
# hadoop的安裝目錄和hive的conf目錄
# Set HADOOP_HOME to point to a specific hadoop install directory
HADOOP_HOME=/home/hadoop/cdh/hadoop-2.5.0-cdh5.3.6
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/home/hadoop/cdh/hive-0.13.1-cdh5.3.6/conf
進(jìn)入hive進(jìn)行測(cè)試
bin/hive
show databases;
二、案例
1妻献、mysql數(shù)據(jù)庫(kù)需要的配置
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://master:3306/hive?createDatabaseIfNotExists=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<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>x5</value>
<description>password to use against metastore database</description>
</property>
2蛛株、接入hue需要的配置
<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
<description>Port number of HiveServer2 Thrift interface.
Can be overridden by setting $HIVE_SERVER2_THRIFT_PORT</description>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>master</value>
<description>Bind host on which to run the HiveServer2 Thrift interface.
Can be overridden by setting $HIVE_SERVER2_THRIFT_BIND_HOST</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://master:9083</value>
</property>
啟動(dòng)hiveserver2
bin/hiveserver2
啟動(dòng)Hive Metastore Server
bin/hive --service metastore -p 9083