Hadoop Learning Record (iv) hadoop2.6 hive configuration

Source: Internet
Author: User
Tags xsl hadoop fs

First, install MySQL

1 Installing the server

sudo apt-get Install Mysql-server

2 Installing the MySQL client

sudo apt-get install mysql-clientsudo apt-get install Libmysqlclient-dev

3 Check if there is a MySQL service open if the second line appears successfully

netstat-tap| grep mysqltcp         0      0 *:mysql                 *:*                     LISTEN      6153

4 turn on the MySQL service command

Service MySQL Start

5root Login New User

Mysql-u root-p

Root initial password is empty, enter the command after the direct carriage.

6 Add user in database User table, username hive, user password hive

CREATE USER Hive' hive'

7 Updating the host of the user table

set host= ' localhost'  where user='hive';
GRANT all privileges on * * '  hive' @'localhost ' Hive ' ; FLUSH privileges;

8 Creating a Hive Database

Create DATABASE hive;

Second, install Hive

1:https://mirrors.tuna.tsinghua.edu.cn/apache/hive/, here I choose the Hive-2.0.0 version.

2 Decompression

TAR-ZXVF apache-hive-2.0. 0-bin.tar.gz

3 I installed under the/usr/local/hive

4 Configuring Hive Environment variables

Vim/etc/profile

Configure as you want but hive and Java must be configured

When you are finished configuring, be sure to

Source/etc/profile

5 Creating a Hive data file directory on HDFs and setting permissions

Hadoop fs-mkdir/-mkdir/user/hive/-chmod g+w/-chmod g+w/user/hive/warehouse

6 copy several template templates under hive/conf and rename

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

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

Hadoop_home=/usr/local/hadoop

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

<?xml version="1.0"encoding="UTF-8"Standalone="No"? ><?xml-stylesheet type="text/xsl"href="configuration.xsl"?><configuration><property> <name>javax.jdo.option.ConnectionURL</name> <value> Jdbc:mysql://localhost:3306/hive?createdatabaseifnotexist=true</value>&LT;DESCRIPTION&GT;JDBC Connectstring  forA JDBC metastore</description></property><property> <name> Javax.jdo.option.connectiondrivername</name> <value>com.mysql.jdbc.Driver</value> < Description>driverclassName forA 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> <property> <name>datanucleus. Readonlydatastore</name> <value>false</value> </property> <property> <name>datanucleus.fixedDatastore</name> <value>false</value> </property> <property> <name>datanucleus.autoCreateSchema</name> <value>true</value> </property> <property> <name>datanucleus.autoCreateTables</name> <value>true</value> </property> <property> <name>datanucleus.autoCreateColumns</name> <value>true</value> </property></configuration>

The last five if not configured, in the 2.0.0 version will be an error

This is just one of the errors, but the recommended modifications for each error are

9 download the corresponding MySQL JDBC driver package and place it in the Lib folder in the Hive installation directory

10 Starting the Hive service

Hive--service Metastore

You'll find some more runjar after the JPS command.

11 Starting Hive

Bin/hive

Into the hive operator interface.

Hadoop Learning Record (iv) hadoop2.6 hive configuration

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.