hive1.2 pseudo-distributed MySQL database configuration detailed

Source: Internet
Author: User

hadoop2.6 pseudo distribution configuration: http://blog.csdn.net/gamer_gyt/article/details/46793731

hive1.2 Derby metabase Configuration: http://blog.csdn.net/gamer_gyt/article/details/47150621

Environment description

hadoop2.6 Pseudo-Distribution Ubuntu14.04 hive 1.1 mysql 5.5 MySQL connection driver 5.1.11

One, hive configuration

1. Extract hive to the appropriate directory (my is/usr/localo/hadoop)

2. Renaming to Hive

3. Setting Environment variables

sudo gedit/etc/profile

Add: Export hive_home=/usr/local/hadoop/hive

Add $HIVE _hiome/bin in Path

4. Under directory $hive_home/conf/, perform the command MV hive-default.xml.template hive-site.xml Rename
Under Directory $hive_home/conf/, perform the command MV hive-env.sh.template hive-env.sh Rename

Under directory $hive_home/bin, modify the file hive-config.sh to add the following:
Export JAVA_HOME=/USR/LOCAL/JDK #你自己的java路径
Export Hive_home=/usr/local/hadoop/hive
Export Hadoop_home=/usr/local/hadoop

Modify hive-env.sh such as:


========================================================================================

At this point, the hive can be used normally, but the Derby database is used at this time, not two machines simultaneously access

========================================================================================

Two, MySQL installation

1. Delete MySQL

a. sudo  apt-get autoremove--purge mysql-server-5.0  b.  sudo  apt-get remove Mysql-serverc.  sudo  apt-get autoremove Mysql-serverd.  sudo  apt-get Remove Mysql-common (very important) 

In fact, some of the above is redundant, it is recommended to follow the order

2. Clean up residual data

Dpkg-l | grep ^rc| awk ' {print $} ' | sudo Xargs dpkg-p

3. Install MySQL

sudo Install mysql-sudoinstall mysql-client

Once the installation is complete, the MySQL server should start automatically. You can check whether the MySQL server is running by running the following command at the terminal prompt:

4. Check if MySQL is running

sudo grep MySQL

When you run the command, you can see a line similar to the following:

[email protected]:~# sudo netstat-tap | grep mysqltcp        0      0 localhost.localdo:mysql *:*                     LISTEN   

If the server does not function correctly, you can start it by using the following command:

sudo /etc/init.d/mysql restart
third, use MySQL as Hive's metastore configuration

1. Place MySQL JDBC driver into Hive's lib directory
2. Modify the Hive-site.xml file, modify the corresponding content as follows:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
</property>

Note: The two root of the above configuration is the username and secret that you typed when you installed MySQL

============================================================================================

At this point, the configuration of MySQL as a metabase has been completed

============================================================================================

Four, wrong

If the installation process is not connected or inaccessible, it may be a permissions issue

Enter the Hadoop installation directory local execution: sudo chown - r Hadoop : hadoop ./ hadoop # Modify file permissions

If Com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications link failure appears

Recommend a good view of the configuration file Hive-site.xml

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

hive1.2 pseudo-distributed MySQL database configuration detailed

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.