First, prepare
Upload apache-hive-1.2.1.tar.gz and Mysql--connector-java-5.1.6-bin.jar to NODE01
Cd/tools
TAR-ZXVF apache-hive-1.2.1.tar.gz-c/ren/
Cd/ren
MV apache-hive-1.2.1 hive-1.2.1
This cluster uses MySQL as the hive metadata store
VI Etc/profile
Export hive_home=/ren/hive-1.2.1
Export path= $PATH: $HIVE _home/bin
Source/etc/profile
Second, install MySQL
Yum-y install MySQL mysql-server mysql-devel
Creating a hive Database Create databases Hive
Create a hive user grant all privileges the hive.* to [e-mail protected] identified by ' 123456 ';
Grant all privileges the hive.* to [email protected] '% ' identified by ' 123456 ';
Three, hive installation
Cd/ren/hive-1.2.1/conf
cp/root/mysql--connector-java-5.1.6-bin.jar/ren/hive-1.2.1/lib/
MV Hive-default-xml.template Hive-site.xml
VI Hive-site.xml
Modify <configuration></configuration>
<property>
<name>hive.exec.scratchdir</name>
<value>/ren/hive-1.2.1/data</value>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/ren/hive-1.2.1/data/tmp</value>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/ren/hive-1.2.1/data/${hive.session.id}_resources</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://node01:3306/hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/ren/hive-1.2.1/warehouse</value>
</property>
<property>
<name>hive.querylog.location</name>
<value>/ren/hive-1.2.1/data/log</value>
</property>
Sync scp-r/ren/hive-1.2.1 [email Protected]:/ren
Scp-r/ren/hive-1.2.1 [Email Protected]:/ren
Start Hive Hive
Start Hiveserver Hive--service Hiveserver2
Start Metastore Hive--service Metastore
Iv. Spark-sql
Cd/ren/spark-2.02/conf
Join File Hive-site.xml
Content <configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://node01:9083</value>
</property>
</configuration>
Boot: spark-sql (requires Metastore to start hive first)
Hadoop-spark cluster Installation---5.hive and spark-sql