**apache-hive-2.1.0-bin.tar.gz**
5.2.2 解压hive~~~shell
[root@uplooking01 /soft]
tar -zxvf apache-hive-2.1.0-bin.tar.gz -C /opt/
~~~
~~~shell
[root@uplooking01 /opt]
mv apache-hive-2.1.0-bin hive
~~~
~~~shell
#配置hive的环境变量
export HIVE_HOME=/opt/hive
export PATH=$PATH:$HIVE_HOME/bin
~~~
~~~shell source /etc/profile ~~~ 5.2.6 配置hive - **重命名模板配置文件** ~~~shell [root@uplooking01 /opt/hive/conf/] mv hive-env.sh.template hive-env.sh mv hive-default.xml.template hive-site.xml mv hive-log4j.properties.template hive-log4j.properties ~~~ - **vim /opt/hive/conf/hive-env.sh 在后面追加下面配置** ~~~shell export JAVA_HOME=/opt/jdk export HADOOP_HOME=/opt/hadoop export HIVE_HOME=/opt/hive ~~~ - **vim /opt/hive/conf/hive-site.xml** ~~~xml将mysql-connector-java-5.1.39.jar拷贝到$HIVE_HOME/lib/目录下**javax.jdo.option.ConnectionURL jdbc:mysql://uplooking05:3306/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName root javax.jdo.option.ConnectionPassword root hive.querylog.location /opt/hive/tmp hive.exec.local.scratchdir /opt/hive/tmp hive.downloaded.resources.dir /opt/hive/tmp ~~~ hive.exec.mode.local.auto true Let Hive determine whether to run in local mode automatically
~~~shell
cp mysql-connector-java-5.1.39.jar /opt/hive/lib/
~~~
~~~shell
schematool -initSchema -dbType mysql
~~~
~~~SHELL
hive
~~~
**Terminal initialization failed; falling back to unsupported**
**将/export/servers/hive/lib 里面的jline2.12替换了hadoop 中/export/servers/hadoop/hadoop-2.6.1/share/hadoop/yarn/lib/jline-0.09*.jar**
==**启动hive时必须保证hadoop集群是启动的**==



