Apache Hive is a data warehouse system built on top of Hadoop that facilitates querying and managing large datasets. Here's a simple guide to install Hive on Kali Linux.
Prerequisites:
-
Java 8 or newer: Hive requires Java to run. Install Java if not already done.
-
Hadoop: Hive requires Hadoop to run, so you need Hadoop installed and configured.
Step-by-Step Guide:
1. Install Java:
Hive requires Java 8 or later. To install Java, run:
sudo apt update
sudo apt install openjdk-11-jdk -y
Check the Java version:
java -version
2. Install Hadoop:
Ensure Hadoop is installed. If you don't have it, install Hadoop first
3. Download Apache Hive:
Go to the directory where you want to install Hive, typically /usr/local:
cd /usr/local
Download the latest stable version of Hive (e.g., version 4.0.1):
wget https://downloads.apache.org/hive/hive-4.0.1/apache-hive-4.0.1-bin.tar.gz
Extract the tarball:
tar -xvzf apache-hive-4.0.1-bin.tar.gz
mv apache-hive-4.0.1-bin hive
4. Set Hive Environment Variables:
Add the following to your ~/.bashrc to set Hive's environment variables:
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
Apply the changes:
source ~/.bashrc
5. Configure Hive:
Navigate to the conf directory and copy the template files to create hive-site.xml:
cd $HIVE_HOME/conf
cp hive-site.xml.template hive-site.xml
Edit hive-site.xml to configure the JDBC URL and other settings (default Derby database works for testing):
nano hive-site.xml
6. Initialize the Hive Metastore:
Hive uses a metastore database (default Derby) to store metadata. Initialize it by running:
schematool -dbType derby -initSchema
7. Start the Hive Metastore:
Run the following to start the Hive Metastore service:
hive --service metastore &
8. Start Hive CLI:
Finally, start the Hive command-line interface (CLI):
hive
Conclusion:
Now, you have Hive up and running on Kali Linux! You can use Hive to manage and query large datasets stored in Hadoop.
For production, you might want to configure a more robust database like MySQL for the metastore instead of Derby.


