Step 1. Download Hive-0.9.0 from the link below.
https://archive.apache.org/dist/hive/hive-0.9.0/
Step 2. Extract the tar file using this command:
Press Enter to continue the extraction process
The extracted files are in the Downloads folder:
Rename the downloaded file to hive:
Step 3. Move Hive to Hadoop directory using the following command:
$ sudo mv 'home/easylearning/Downloads/hive'
/user/local/Hadoop
Check whether hive has successfully moved or not.
Go to the moved directory, using this command:
$ cd usr/local/hadoop
See the list of directories or files which are contained in Hadoop folder, by using list(ls -l) command.
/usr/local/hadoop$ ls -l
Step 4. Open the bashrc file by using the command:
$ sudo gedit $HOME/.bashrc
Now set the Hive-related environment variables by adding these lines to the bashrc file :
export HADOOP_HOME=/usr/local/hadoop
export HIVE_HOME=/usr/local/hadoop/hive
export PATH=$PATH:$HIVE_HOME/bin
export PATH=$PATH:$HADOOP_HOME/bin
Step 5. Create Hive directories within HDFS using the command
$ bin/hadoop dfs -mkdir /user/hive/warehouse
Create a temporary directory using the command
$ bin/hadoop dfs -mkdir /temp
Step 6. Change permissions of the directory which are created above, using the command:
$ bin/hadoop dfs -chmod g+w /user/hive/warehouse
$ bin/hadoop dfs -chmod g+w /temp
Step 7. Open the Hive configuration file using the following command:
$ sudo gedit '/usr/local/hadoop/hive/bin/hive-config.sh'
Set the HADOOP_HOME in the config.sh file, by adding this line at the end of the file
export HADOOP_HOME=/user/local/hadoop
Step 8. Go to the Hive directory using the command
$ cd /usr/local/hadoop/hive
Launch hive using the following command
$ bin/hive
ConversionConversion EmoticonEmoticon