1. Download the hive0.14.0 version to http://www.apache.org/dyn/closer.cgi/hive/
2. Use the CP command to copy to a Linux host under Hadoop user
The Hadoop user I'm using here is QHG
3. Use the TAR-ZXVF command to extract, after the decompression because the name is too long, using the MV to rename
4. Configure environment Variables for hive
Add the Hive_home in the. bash_profile file, and then add the Hive_home/bin directory to the path
Then source. bash_profile to make the environment variable effective
5. Modify the Hive configuration file
A. There are several template files under hive/conf/
B. Copy the Hive-env.sh.template file and name it hive-env.sh
Command for CP Hive-env.sh.template hive-env.sh
C.HIVE-ENV.SH is the environment configuration ask price of hive, need to modify the directory of Hadoop and hive conf directory, etc.
Open hive-env.sh file using VI
Wq Save exit.
D. Copying files hive-default.xml.template rename to Hive-site.xml
Command: CP hive-default.xml.template Hive-site.xml
Delete the content between <configuration> </configuration> (enter in VI Command mode: 21,3395D carriage return)
Copy the following in the previous section
1 < Property> 2 <name>Hive.metastore.local</name> 3 <value>True</value> 4 </ Property> 5 < Property> 6 <name>Javax.jdo.option.ConnectionURL</name>7 <value>Jdbc:mysql://localhost:3306/hive?characterencoding=utf-8</value> 8 </ Property> 9 < Property> Ten <name>Javax.jdo.option.ConnectionDriverName</name> One <value>Com.mysql.jdbc.Driver</value> A </ Property> - < Property> - <name>Javax.jdo.option.ConnectionUserName</name> the <value>Root</value> - </ Property> - < Property> - <name>Javax.jdo.option.ConnectionPassword</name> + <value>Root</value> - </ Property>
Where jdbc:mysql://localhost:3306/hive?characterencoding=utf-8,localhost:3306/hive is the address and port number of the MySQL server
Hive is a database of hive Metastore in MySQL and needs to be created when MySQL is installed later.
6. Using MySQL as the hive Metastore
A. Switch to the root user to install MySQL
Yum Install Mysql/yum Install Mysql-server
B. Start the MySQL service
Service mysqld Start (you can use service mysqld status to see if the MySQL service starts correctly)
C. Set the MYSQLD service to boot from boot
Chkconfig mysqld on
D. Use the Mysql_secure_installation command to set the MySQL password
After running the command, you will be prompted to change the MySQL password, enter y here.
Then enter the new password root, enter the new password root again, then ask whether to delete the anonymous user, enter N;
Immediately after asking if you want to close the root login, enter n;
Ask if you want to delete the MySQL test database, enter N, and then ask if you want to refresh the permissions table and enter Y.
E. To enable hive to have remote login and access to MySQL, use the mysql-u username-p password
I set the root password to root in the D process, so the command executed for mysql-uroot-proot enter the MySQL shell
In MySQL shell execute grant all on hive.* to ' root ' @ '% ' identified by ' root '; Command
In this case, if root password is not root, then modify it accordingly.
and create a database named hive in MySQL (the name of the database is specified by hive in Javax.jdo.option.ConnectionURL's value)
F. Switch to the root user and restart the MySQL service using service mysqld restart
G. Finally, you will need to install the JDBC driver.
Use the RPM-QFL Mysql-connector-java command to find the location of the MySQL JDBC driver jar file,
Typically put in/usr/share/java/mysql-connector-java.jar, copy it to the $HIVE _home/lib directory, and modify the permissions of the file
7. Start hive and make sure Hadoop starts successfully before starting
Enter Hive carriage return
Execute a simple SQL validation hive after entering Hive's command-line mode
Example: show databases;
Installing the Hive0.14.0 on the Hadoop2.6.0