Steps to Install Hive on Ubuntu
Create a directory named Hive and download Hive tar file. Hive tar file can be downloaded using then wget as shown below
The downloaded Hive tar file needs to be extracted using the tar command with –xvf option as shown below –
Verify if the tar file has been uncompressed using the list command ‘ls’
To access hive hadoop from any path, its environment variable must be set in the ~/.bashrc file that is present at the $HOME directory.
export HIVE_HOME=”/usr/local/hive/ apache-hive-3.1.2-bin”
For the environment variables to be set as mentioned in the .bashrc file, the file needs to be sourced using the ‘source’ command-
For Hive to interact with Hadoop HDFS, it must know the path to the hadoop installation directory. This can be achieved by configuring one of the hadoop hive configuration files hive-config.sh.
Set HADOOP_HOME in hive-config.sh
export HADOOP_HOME=<hadoop path>
let’s inform hive about the database that it should use for its schema definition. The below command tells hive to use derby database as its metastore database. We can also specify this in the hadoop hive configuration file ‘hive-site.xml’ file.
$HIVE_HOME/bin/schematool –initschema –dbtype derby
we are all set to launch the Hive shell - just type hive make sure hadoop services are running