1、安裝mysql?
2拯辙、安裝hive
? ? 下載?壓縮包并解壓
$ wget?https://archive.apache.org/dist/hive/hive-1.2.2/apache-hive-1.2.2-bin.tar.gz
$ tar -zxvf?apache-hive-1.2.2-bin.tar.gz -C /soft/
$cd /soft/
$ln -s?apache-hive-1.2.2-bin hive
? ? 修改環(huán)境變量?驗(yàn)證
$ vim /etc/profile
添加:
? ? HIVE_HOME=/soft/hive
并在path?添加?到bin
$?source /etc/profile
$hive --version
?? ?修改以下兩個(gè)文件:
1凉泄、hive-site.xml
將${system:java.io.tmpdir}統(tǒng)一換成/hive
將${system:user.name}統(tǒng)一換成root
在vim命令行模式下進(jìn)行統(tǒng)一替換
%s/${system:java.io.tmpdir}/\/hive/g
%s/${system:user.name}/root/g
將以下部分貼在配置文件尾部:
<property>
??????<name>javax.jdo.option.ConnectionURL</name>
??????<value>jdbc:mysql://192.168.248.101: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>
2荤胁、修改hive-env.sh
? ? 添加
?? ?? ? HADOOP_HOME=/soft/hadoop
安裝MySQL連接工具
1)下載安裝包
wget thttps://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.44.tar.gz
tar zxvf mysql-connector-java-5.1.44.tar.gz
2)復(fù)制連接庫(kù)文件
cp mysql-connector-java-5.1.44-bin.jar /usr/local/src/apache-hive-1.2.2-bin/lib
更新jline.jar
在早期Hadoop版本中 jline.jar的版本是0.9+ 使用這個(gè)版本會(huì)報(bào)錯(cuò)缚甩,所以要替換成新版本的Jar包;更換hadoop的包
cp /soft/hive/lib/jline-2.12.jar /soft/hadoop/share/hadoop/yarn/lib