hive1.2 pseudo-distributed MySQL database configuration specific explanation

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 corresponding folder (my is/usr/localo/hadoop)

2. Renaming to Hive

3. Environment variable Settings

sudo gedit/etc/profile

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

Add $HIVE _hiome/bin in Path

4. Under Folder $hive_home/conf/, Run command mv hive-default.xml.template hive-site.xml Rename
Under Folder $hive_home/conf/, run the command MV hive-env.sh.template hive-env.sh Rename

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

Change hive-env.sh for example with:


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

At this point, hive can be used normally. Only the Derby database is used at this time. Two machines are not allowed to interview at the same time.

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

Two, MySQL installation

1. Delete MySQL

< Span style= "font-size:14px" >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 (important )

In fact, some of the above is superfluous, and it is advisable to run it in 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, MySQLServer should initiate it on its own initiative. You can check if MySQL server is executing by executing the following command at the terminal prompt:

4. Check if MySQL is executing

sudo grep MySQL

When you execute the command, you can see a line that resembles the following:

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

Assuming that the server is not performing properly, you can start it with 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 folder
2. Change the Hive-site.xml file. Change the corresponding content such as the following:
<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, Hive Web interface interview

1. Download the Hive-hwi-0.13.1.war copy to the Lib folder in the Hive folder

2. Copy the Tools.jar under the Lib folder of the Java installation folder to the Lib folder under the Hive folder

Interview interface


Five. Wrong

If there is no connection or access to the installation process, it may be a permissions issue

Enter the Hadoop installation folder local run: sudo chown - r Hadoop : hadoop ./ hadoop # Change file permissions

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

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

hive1.2 pseudo-distributed MySQL database configuration specific explanation

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.