Hive: Like a data warehouse that manages Hadoop data while looking at Hadoop data, hive is like a SQL parsing engine, and hive can convert SQL operations into Mr Jobs, so the hive operation language is also called Hsql, Data is usually stored in Derby and MySQL. Derby default, due to its limitations, is not used, the author uses the MySQL database.
Version:
hadoop1.2.1:
Apache-hive-0.13.1-bin.tar.gz
Mysql-5.5-server
Mysql-5.5-client
Mysql-connector-java-5.1.10.jar
1. Install MySQL First
sudo apt-get install Mysql-server
sudo apt-get install mysql-client
sudo apt-get install Libmysqlclient-dev
2. Follow the prompts to set up MySQL
3. Installing hive
Copy hive to/usr
3.1 Decompression:
sudo tar-zxvf apache-hive-0.13.1-bin.tar.gz
3.2 Renaming:
sudo mv hive-0.13.1 Hive
3.3 Environment Variables:
sudo vim/etc/profile
Note Hive_home and path
Source/etc/profile
3.4 Rename the following file in/usr/hive/conf
sudo mv Hive-default.xml.template hive-site.xml
sudo mv Hive-env.sh.template hive-env.sh
3.5 Modifying a hadoop-env.sh file under Hadoop
3. 6 Modify/usr/hive/bin/hive-config.sh
3.7 Hive Installation Complete
Enter bin/below to execute hive into hive shell
4 MySQL is connected to hive:
4.1 Copy the Mysql-connector-java-5.1.10.jar to the/usr/hive/lib first.
4.2 Modifying the configuration file/usr/hive/conf/hive-site.xml (renamed)
Table storage location under HDFs:
About MySQL settings: According to your own MySQL configuration
5. Test Link success:
Mysql-uroot-p Password
show databases;
You will see the hive database.
6. You can create a table operation in hive.
Hive and MySQL installation and use