Hive Installation on Ubuntu:
Please follow the below steps to install Apache Hive on Ubuntu:
Step 1: Download Hive tar.
Command: wget -c http://archive.apache.org/dist/hive/hive-0.9.0/hive-0.9.0-bin.tar.gz
Step 2: Extract the tar file.
Command: tar -xzvf hive-0.9.0-bin.tar.gz
Step 3: Edit the “.bashrc” file to update the environment variables for user.
- hadoop fs -mkdir /user/hive/warehouse
- hadoop fs -mkdir /temp
- hadoop fs -chmodg+w /user/hive/warehouse
- hadoop fs -chmodg+w /temp
Command: sudo gedit .bashrc
Add the following at the end of the file:
export HADOOP_HOME=/home/user/hadoop-1.2.0
export HIVE_HOME=/home/user/hive-0.9.0-bin
export PATH=$PATH:$HIVE_HOME/bin
export PATH=$PATH:$HADOOP_HOME/bin
Step 4: Create Hive directories within HDFS.
Command:
The directory ‘warehouse’ is the location to store the table or data related to hive.
The temporary directory ‘temp’is the temporary location to store the intermediate result of processing.
Step 5: Set read/write permissions for table.
Command:
In this command we are giving written permission to the group:
Step 6: Set Hadoop path in Hive config.sh.
Command: sudo gedit hive-config.sh
Step 7: Launch Hive.
Command: hive
Step 8: Create sample tables.
Command: hive> CREATE TABLE shakespeare (freq INT, word STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\t’ STORED AS TEXTFILE;
Create sample tables:
Step 9: To exit from Hive:
Command: hive> exit;
ReplyDeleteIt was really a nice article and i was really impressed by reading this Big data hadoop online Course