Install pseudo-distributed hive-0.14.0 under Ubuntu 14.10

Source: Internet
Author: User
Tags hadoop fs

Native standalone mode, mysql as meta database

1 Installation Environment Preparation

1.1 Installing the JDK is installed when Hadoop is installed, refer to http://www.cnblogs.com/liuchangchun/p/4097286.html

1.2 Installing Hadoop, refer to Http://www.cnblogs.com/liuchangchun/p/4097286.html

1.3 Installing the MySQL database, refer to http://www.cnblogs.com/liuchangchun/p/4099003.html

1.4 New Hive Database, user, granting permissions

Mysql-U root-PInsert  into User(Host,User, Password)Values("localhost", "Hive", Password ("Hive")); FLUSHPrivileges;GRANT  All Privileges  on *.*   to 'Hive'@'localhost'Identified by 'Hive'; FLUSHPrivileges;
Create database hive;

2 Installing Hive

2.1 Download the latest hive, url http://mirror.bit.edu.cn/apache/hive/, I downloaded Apache-hive-0.14.0-bin

2.2 Extract to the appropriate directory

2.3 Configuring Hive Environment variables

sudo nano/etc/profile
Export JAVA_HOME=/USR/DEV/JDK1.7.0_51export Ld_library_path=/home/lcc/software/dev/protobuf-2.5.0Export Ant_home=/usr/dev/apache-ant-1.9.4Export Hadoop_home=/home/lcc/software/hadoop/hadoop-2.5.0Export Hbase_home=/home/lcc/software/hadoop/hbase-0.99.0Export Hive_home=/home/lcc/software/hadoop/apache-hive-0.14.0-Bin Export PATH=$PATH:$ANT _home/bin:$JAVA _home/bin:$HADOOP _home/bin:$HBASE _home/bin:$HIVE _home/Binexport CLASSPATH=$CLASSPATH:$JAVA _home/lib

2.4 Modify several template templates under hive/conf and rename them to other

CP Hive-env.sh.template Hive-env. shcp Hive-default.xml.template hive-site.xml

2.5 Configuring the Hive-env.sh file, specifying Hadoop_home

hadoop_home=/home/lcc/software/hadoop/hadoop-2.5. 0

2.6 Modify the Hive-site.xml file, specify the MySQL database driver, database name, user name and password, modify the contents as follows

< Property>  <name>Javax.jdo.option.ConnectionURL</name>  <value>Jdbc:mysql://localhost:3306/hive?createdatabaseifnotexist=true</value>  <Description>JDBC connect string for a JDBC Metastore</Description></ Property>< Property>  <name>Javax.jdo.option.ConnectionDriverName</name>  <value>Com.mysql.jdbc.Driver</value>  <Description>Driver class name for a JDBC metastore</Description></ Property>< Property>  <name>Javax.jdo.option.ConnectionUserName</name>  <value>Hive</value>  <Description>Username to use against Metastore database</Description></ Property>< Property>  <name>Javax.jdo.option.ConnectionPassword</name>  <value>Hive</value>  <Description>Password to use against Metastore database</Description></ Property>< Property>  <name>Hive.metastore.local</name>  <value>True</value>  <Description></Description></ Property>

2.7 Modify the hive-config.sh file under Hive/bin, set the Java_home,hadoop_home

Export JAVA_HOME=/USR/DEV/JDK1. 7. 0_51export hadoop_home=/home/lcc/software/hadoop/hadoop-2.5. 0 export hive_home=/home/lcc/software/hadoop/apache-hive-0.14. 0-bin

2.8 Download Mysql-connector-java-5.1.27-bin.jar file and put it in the $hive_home/lib directory

2.9 Create/tmp and/user/hive/warehouse in HDFs and set permissions

Hadoop FS-mkdir /-mkdir /user/hive/-chmod g+w/-  chmod G+w/user/hive/warehouse

2.10 Start Hadoop. Go to Hive shell and enter some commands to view

Hiveshow databases;show tables;

2.11 You can view the files in the hive production in Hadoop

Hadoop Dfs-ls/user/hive/warehouse

--------------------------------------------------------------------------------------------------------------- --

It's supposed to store hive metadata in MySQL, but I don't have it in MySQL, I don't know why ....

Install pseudo-distributed hive-0.14.0 under Ubuntu 14.10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.