Hive环境搭建
Hadoop生态圈软件下载地址:http://archive.cloudera.com/cdh5/cdh/5/
==================================
Hadoop部署 hadoop-2.6.0-cdh5.7.0.tar.gz
Hive部署 hive-1.1.0-cdh5.7.0.tar.gz
需要有java
需要已经部署好mysql
===================================
#软件统一放在/opt/software下
cd /opt/software
上传hive-1.1.0-cdh5.7.0.tar.gz
tar -zxvf hive-1.1.0-cdh5.7.0.tar.gz
配置到系统环境变量: ~/.bash_profile 或者 /etc/profile
export HIVE_HOME=/opt/software/hive-1.1.0-cdh5.7.0
export PATH=$HIVE_HOME/bin:$PATH
cd /opt/software/hive-1.1.0-cdh5.7.0/conf
在 hive-env.sh 修改
HADOOP_HOME=/home/hadoop/app/hadoop-2.6.0-cdh5.7.0
chmod 755 hive-env.sh #这一步可以不做
添加文件 vi hive-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/ruoze_hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password</value> #自己mysql 的密码
</property>
</configuration>
拷贝mysql驱动到$HIVE_HOME/lib/
在lib中上传 mysql-connector-java-5.1.27-bin.jar
[root@hadoop002 lib]# hive
which: no hbase in (/opt/software/hive-1.1.0-
cdh5.7.0/bin:/opt/software/zookeeper/bin:/opt/software/hadoop/bin:/opt/software/hadoop/sbin:/opt/software/findbugs-
1.3.9/bin:/usr/local/protobuf/bin:/opt/software/apache-maven-
3.3.9/bin:/usr/java/jdk1.8.0_144/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/softwa
re/hadoop/bin)
Logging initialized using configuration in jar:file:/opt/software/hive-1.1.0-cdh5.7.0/lib/hive-common-1.1.0-
cdh5.7.0.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive>
结束
Hadoop生态圈软件下载地址:http://archive.cloudera.com/cdh5/cdh/5/
==================================
Hadoop部署 hadoop-2.6.0-cdh5.7.0.tar.gz
Hive部署 hive-1.1.0-cdh5.7.0.tar.gz
需要有java
需要已经部署好mysql
===================================
#软件统一放在/opt/software下
cd /opt/software
上传hive-1.1.0-cdh5.7.0.tar.gz
tar -zxvf hive-1.1.0-cdh5.7.0.tar.gz
配置到系统环境变量: ~/.bash_profile 或者 /etc/profile
export HIVE_HOME=/opt/software/hive-1.1.0-cdh5.7.0
export PATH=$HIVE_HOME/bin:$PATH
cd /opt/software/hive-1.1.0-cdh5.7.0/conf
在 hive-env.sh 修改
HADOOP_HOME=/home/hadoop/app/hadoop-2.6.0-cdh5.7.0
chmod 755 hive-env.sh #这一步可以不做
添加文件 vi hive-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/ruoze_hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password</value> #自己mysql 的密码
</property>
</configuration>
拷贝mysql驱动到$HIVE_HOME/lib/
在lib中上传 mysql-connector-java-5.1.27-bin.jar
[root@hadoop002 lib]# hive
which: no hbase in (/opt/software/hive-1.1.0-
cdh5.7.0/bin:/opt/software/zookeeper/bin:/opt/software/hadoop/bin:/opt/software/hadoop/sbin:/opt/software/findbugs-
1.3.9/bin:/usr/local/protobuf/bin:/opt/software/apache-maven-
3.3.9/bin:/usr/java/jdk1.8.0_144/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/softwa
re/hadoop/bin)
Logging initialized using configuration in jar:file:/opt/software/hive-1.1.0-cdh5.7.0/lib/hive-common-1.1.0-
cdh5.7.0.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive>
结束