2019 Unicorn Enterprise Heavy Gold Recruitment Python Engineer Standard >>> 
Install hive under hadoop user
1. Set environment variables
vim ~/.bashrc
export HIVE_HOME=/home/hdpsrc/hive
export PATH=$PATH:$HIVE_HOME/bin
source .bash_profile
2. Modify the configuration file
hive-site.xml
cp hive/conf/hive-default.xml.template hive/conf/hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL </name>
<value>jdbc:mysql://192.168.0.0:3306/hive </value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName </name>
<value>com.mysql.jdbc.Driver </value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword </name>
<value>hive </value>
</property>
<property>
<name>hive.exec.scratchdir </name>
<value>hdfs://172.16.1.2:9000/tmp </value>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>hdfs://172.16.1.2:9000/user/hive/warehouse</value>
</property>
<property>
<name>hive.hwi.listen.port </name>
<value>9999 </value>
<description>This is the port the Hive Web Interface will listen on </descript ion>
</property>
<property>
<name>datanucleus.autoCreateSchema </name>
<value>true</value>
</property>
<property>
<name>datanucleus.fixedDatastore </name>
<value>false</value>
</property>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
<description>Username to use against metastore database</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/home/hive/iotmp</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/home/hive/iotmp</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
<property>
<name>hive.querylog.location</name>
<value>/home/hive/iotmp</value>
<description>Location of Hive run time structured log file</description>
</property>
3.
mv /home/hadoop/Desktop/mysql-connector-java-5.1.6-bin.jar /home/hive/lib/
4.
mkdir /home/hive/iotmp
5. Start hive, test
/home/hive/bin
hive
show databases;