hadoop入门学习系列之四hadoop的hive安装和配置
tar -zxvf apache-hive-1.2.2-bin.tar.gz
cd apache-hive-1.2.2-bin/conf/
1. 创建hive-site.xml文件,添加以下内容:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Hive Execution Parameters -->
<property>
<name>hive.metastore.local</name>
<value>true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://10.10.0.140:3306/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>hadoopuser</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
</configuration>
2. 修改hive-env.sh文件,
export JAVA_HOME=/opt/softwares/jdk1.7.0_80
export HADOOP_HOME=/opt/softwares/hadoop-2.6.5
3. 修改/etc/profile文件
export HIVE_HOME=/opt/softwares/apache-hive-1.2.2-bin
export PATH=$PATH:$HIVE_HOME/bin
source /etc/profile
4. 把mysql的jdbc驱动的jar包移动到/apache-hive-1.2.2-bin/lib文件夹下,否则hive连接mysql的时候会报错。
hive --service metastore
hive --service hiveserver2
执行hive
会报一个jline错误
要把hive下的jar包复制到hadoop目录下