1. Download hadoop-1.2.1-bin.tar.gz
Unzip, modify the name to hive
MV to/opt/hive
2. Configure Hive
CP Hive-default.xml.template Hive-site.xml
Modify Hive-site.xml
CP Hive-log4j.properties.template Hive-log4j.properties
modifying hive-env.sh, configuring environment variables
3. Install MySQL
sudo yum install Mysql-server
Change root password
mysqld admin-uroot Password root
Create a hive User
Mysql>create user ' hive ' @ ' localhost ' identfied by ' hive ';
Give hive full permissions
Mysql>grant Privileges On * * to [email protected];
Refresh
Mysql>flush privileges;
Log in to hive and create a hive database
Mysql>create database hive;
4. Create an HDFs directory
Hive default Database configuration directory is/user/hive/warehouse
Create/user/hive/warehouse
Hadoop fs-mkdir-p/user/hive/warehouse
Update permissions
Hadoop Fs-chmod G+w/user/hive/warehouse
Create/tmp/hive
Hadoop Fs-chmod 777/tmp/hive
5. Add Hive Environment variables
VI ~/.BASHRC
Export path= $PATH:/opt/hive/bin
SOURCE ~/.BASHRC
5. Using Hive
>hive
Hive>create table test (id int, name string);
Drawings: Hive Run Udaf
Hive Installation Tutorial