Steps to install Hive in Ubuntu:
-
install java
Enter the following command in Terminal to install Java:
sudo apt-get update sudo apt-get install default-jdk
-
Download Hive
Enter the following command in the terminal to download Hive:
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz
This command will download the compressed package of Hive from the Tsinghua Mirror Station.
-
Unzip Hive
Enter the following command in the terminal to extract Hive:
tar -zxvf apache-hive-3.1.2-bin.tar.gz
This command will decompress Hive into the apache-hive-3.1.2-bin directory in the current directory.
-
Configure Hive
Open the Hive configuration file hive-env.sh and add the following configuration:
export HADOOP_HOME=/path/to/hadoop export HIVE_CONF_DIR=/path/to/hive/conf
Among them, '/path/to/hadoop' is the path where you installed Hadoop, and '/path/to/hive/conf' is the path where you store the Hive configuration file.
-
Start Hive
Enter the following command in the terminal to start Hive:
cd apache-hive-3.1.2-bin bin/hive
This command starts Hive's command-line interface.
-
Test Hive
Enter the following command in Hive's command line interface to test Hive:
show databases;
If Hive is working properly, it will list all databases.
Hope these steps help you to install Hive in Ubuntu.