Installing hive using remote MySQL as a metabase

Source: Internet
Author: User

Environment:
CentOS6.6 hadoop1.2.1 mysql5.1.73

1. Download
[Email protected] ~]$ wget http://mirrors.cnnic.cn/apache/hive/hive-1.0.0/apache-hive-1.0.0-bin.tar.gz

2. Decompression
[Email protected] ~]$ TAR-ZXF apache-hive-1.0.0-bin.tar.gz

3. Setting Environment variables
[[email protected] ~]$ vim. Bash_profile
Hive_home=/home/grid/apache-hive-1.0.0-bin
Path= $PATH: $HIVE _home/bin
Classpath= $CLASSPATH: $HIVE _home/lib
Export Hive_home PATH CLASSPATH

[[email protected] ~]$ source. bash_profile

4. Edit Hive Configuration file
A, edit hive-env.sh, specify Hadoop_home, Hive_conf_dir
[Email protected] conf]$ pwd
/home/grid/apache-hive-1.0.0-bin/conf
[email protected] conf]$ CP hive-env.sh.template hive-env.sh
[Email protected] conf]$ vim hive-env.sh
# Set Hadoop_home to point to a specific HADOOP install directory
hadoop_home=/home/grid/hadoop-1.2.1
# Hive Configuration Directory can be controlled by:
Export hive_conf_dir=/home/grid/apache-hive-1.0.0-bin/conf

B, edit hive-site.xml, modify database connection properties (javax.jdo.option.connectionurl/connectiondrivername/connectionusername/ Connectionpassword)
[email protected] conf]$ CP hive-default.xml.template Hive-site.xml
[Email protected] conf]$ VI hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.0.103:3306/hivedb</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://192.168.0.104:9083</value>
<description>thrift URI for the remote Metastore. Used by Metastore client-to-connect to remote metastore.</description>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>

5. Copy the MySQL JDBC driver package to the Lib directory of Hive

6. Start Hive (Hadoop is started)
Start the service side
[Email protected] ~]$ hive--service Metastore
Starting Hive Metastore Server

Start the client
[Email protected] ~]$ hive

Logging initialized using configuration in jar:file:/home/grid/apache-hive-1.0.0-bin/lib/hive-common-1.0.0.jar!/ Hive-log4j.properties
Hive>





Installing hive using remote MySQL as a metabase

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.