一.Hive的安装部署

系统

Centos 6.5

hadoop 2.5.0

zookeeper 3.4.5

Hive 0.9.0

下载 解压就不说了

①:createDatabaseIfNotExist=true 表示如果该mysql数据库中没有名为"hive"的数据库则创建;


进入 hive/conf 目录

cd ./hive-0.9.0/conf

配置hive-site.xml

cp hive-default.xml.template hive-site.xml

修改hive-site.xml配置


<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=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>root</value>
  <description>password to use against metastore database</description>
</property>



配置完以后启动 Hive
./bin/hive
------------------------
hive> show tables;
FAILED :Execution Error ,return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask .....
表示连接mysql数据库失败,没有加载mysql jdbc 驱动包
Url:http://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.38.zip


-----------------------
hive> show tables;
OK
Time taken: 5.944 seconds
表示连接mysql数据库成功

你可能感兴趣的:(一.Hive的安装部署)