Apache Hive - JadenGil/Jaden-Tech-Journal GitHub Wiki
How to install apache hive.
Before installing apache hive you need to install Java:
sudo yum install java-1.8.0-openjdk-devel
Then you'll need to install the latest version of apache hive:
wget https://apache.claz.org/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz
tar zxvf apache-hive-3.1.2-bin.tar.gz
sudo mv apache-hive-3.1.2-bin /usr/local/hive
in the .bashrc file check the environment variables
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
Make a new dir for apache hive:
sudo mkdir -p /usr/local/hive/metastore_db
and give it permissions (I just gave it full access for the ease of the lab)
sudo chmod -R 777 /usr/local/hive/metastore_db
You'll then need to configure the metastore database so you'll need to edit the hive-site.xml file
sudo vi /usr/local/hive/conf/hive-site.xml
(file location)
add the following:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:/usr/local/hive/metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of Hive table data in HDFS</description>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
<description>verify schema consistency at startup</description>
</property>
</configuration>
Start the hive metastore service:
nohup /usr/local/hive/bin/hive --service metastore &
and the the hive shell
/usr/local/hive/bin/hive