Install Hive on Ubuntu

This post is about the installation of Hive on Ubuntu. The environment of my system is ubuntu12.04, hadoop1.0.3, hive 0.9.0. Supposing the hadoop is installed.

The details of installation for hive describe as follows:

step 1: download hive-0.9.0.tar.gz from the url: http://hive.apache.org/index.html

step 2: uncompress the above file using linux command in the shell.

$ sudo tar -xzf hive-0.9.0.tar.gz

step 3: copy the uncompressed files to the directory /home/hadoop/.

$ sudo cp -r /home/user/hive-0.9.0 /home/hadoop/

step 4: entry the configure directory of hive and copy the configure file.

$ cd /home/hadoop/hive-0.9.0/conf

$ sudo cp hive-env.sh.template hive-env.sh

step 5: modify the configure file in the last line as follows:

$ sudo gedit hive-env.sh

#add the below configure information

export Hadoop_HOME=/home/hadoop/hadoop-1.0.3

export HIVE_HOME=/home/hadoop/hive-0.9.0

export PATH=$PATH:$HIVE_HOME/bin

step 6: change the directory of hive to the hadoop user.

$ sudo chown -R hadoop:hadoop hive-0.9.0

step 7: start hive and test hive

$ bin/hive or bin/hive start or ./hive

$ show tables;

$ create database hive;

$ use hive;

$ create table test(id int,name string);

 

你可能感兴趣的:(linux,hadoop,hive)