Verifying the Installation of Apache Hive on Ubuntu-complete guide

3/16/2025

Verify Apache Hive installation

Go Back

Verifying the Installation of Apache Hive on Ubuntu

After successfully installing Apache Hive on your system, it's essential to verify that the installation was completed correctly. This guide will help you run basic checks to ensure that Hive is properly configured and functioning with Hadoop.

Prerequisites

  • Java installed and configured
  • Hadoop running successfully
  • Hive installation completed
Verify Apache Hive installation

Step 1: Verify Environment Variables

Ensure that the Hive and Hadoop environment variables are set properly:

echo $HADOOP_HOME
echo $HIVE_HOME

If the correct paths are displayed, the environment variables are configured correctly.

Step 2: Start Hadoop Services

Navigate to the Hadoop directory and start the HDFS and YARN services:

start-dfs.sh
start-yarn.sh

Check the status of the services to confirm that all daemons are running:

jps

Expected output includes Namenode, Datanode, ResourceManager, and NodeManager.

Step 3: Launch HiveServer2

Start the HiveServer2 service:

$HIVE_HOME/bin/hiveserver2

You should see logs indicating that HiveServer2 has started successfully.

Step 4: Connect to Hive Using Beeline

Open a new terminal and connect to Hive using Beeline:

$HIVE_HOME/bin/beeline -u jdbc:hive2://localhost:10000 -n hive

Step 5: Run Basic Hive Queries

Check the available databases:

show databases;

Create a sample database to test Hive functionality:

create database hive_test;

Verify the newly created database:

show databases;

The output should display the hive_test database.

Step 6: Check Hive Metastore

If you’re using Derby as the metastore, you can check the metastore logs for any errors. For MySQL or PostgreSQL metastore, verify the connection and schema initialization.

Step 7: Verify Hive Warehouse Directory in HDFS

Ensure the Hive warehouse directory exists in HDFS:

hadoop fs -ls /user/hive/warehouse

The warehouse directory should be accessible and writable.

Conclusion

By following these steps, you can verify that Hive is installed and functioning correctly on your Ubuntu system. This verification process ensures that Hive is ready for executing queries and managing large datasets efficiently. For more Hive tutorials, visit orientalguru.co.in!

Table of content