Install and configure hive-2.1.0 under Ubuntu system

Source: Internet
Author: User
Tags postgres database

I. Downloads for mysql-server and mysql-client

[Email protected]:/usr/local# sudo apt-get install mysql-server mysql-client (Ubuntu version)

Here I am, root password, for rootroot.

 

second, start MySQL Service

[Email protected]:/usr/local# sudo/etc/init.d/mysql start (Ubuntu version)
* Starting MySQL database server mysqld [OK]
[Email protected]:/usr/local#

Third, enter the MySQL service

There is a benefit in the Ubuntu MySQL, directly to the [email protected] under all, their own default settings

[Email protected]:/usr/local# mysql-uroot-p
Enter Password: //input Rootroot
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 43
Server version:5.5.53-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> CREATE database if not exists hive_metadata;
Query OK, 1 row Affected (0.00 sec)

Mysql> Grant all privileges in hive_metadata.* to ' hive ' @ ' percent ' identified by ' hive ';
Query OK, 0 rows Affected (0.00 sec)

Mysql> Grant all privileges in hive_metadata.* to ' hive ' @ ' localhost ' identified by ' hive ';
Query OK, 0 rows Affected (0.00 sec)

Mysql> Grant all privileges in hive_metadata.* to ' hive ' @ ' Sparksinglenode ' identified by ' hive '; Note that Sparksinglenode is my hostname, don't copy it .
Query OK, 0 rows Affected (0.00 sec)

Mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)

Mysql>Use hive_metadata;
Database changed
Mysql>select User,host,password from Mysql.user;
+------------------+-----------------+-------------------------------------------+
| user | Host | password |
+------------------+-----------------+-------------------------------------------+
| Root | localhost | *6c362347ebeaa7df44f6d34884615a35095e80eb |
| Root | Sparksinglenode | *6c362347ebeaa7df44f6d34884615a35095e80eb |
| Root | 127.0.0.1 | *6c362347ebeaa7df44f6d34884615a35095e80eb |
| Root | :: 1 | *6c362347ebeaa7df44f6d34884615a35095e80eb |
| Debian-sys-maint | localhost | *5dd77395eb71a702d01a6b0fadd8f2c0c88830c5 |
| Hive | % | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| Hive | localhost | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| Hive | Sparksinglenode | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
+------------------+-----------------+-------------------------------------------+
8 rows in Set (0.00 sec)

Mysql> exit;
Bye
[Email protected]:/usr/local#

Iv. Installing Hive

Here, very simple, not much to repeat.

[Email protected]:/usr/local/hive$ ll
Total 12
Drwxr-xr-x 3 spark Spark 4096 November 21 10:39.
Drwxr-xr-x root root 4096 November 21 10:25. /
Drwxrwxr-x 9 spark spark 4096 November 10:38 apache-hive-2.1.0-bin/
[Email protected]:/usr/local/hive$MV Apache-hive-2.1.0-bin hive-2.1.0
[Email protected]:/usr/local/hive$ ls
hive-2.1.0
[Email protected]:/usr/local/hive$ cd hive-2.1.0/
[Email protected]:/usr/local/hive/hive-2.1.0$ ls
Bin examples jdbc LICENSE README.txt scripts
Conf hcatalog Lib NOTICE release_notes.txt
[Email protected]:/usr/local/hive/hive-2.1.0$ cd conf/
[Email protected]:/usr/local/hive/hive-2.1.0/conf$ ls
Beeline-log4j2.properties.template Ivysettings.xml
Hive-default.xml.template llap-cli-log4j2.properties.template
Hive-env.sh.template llap-daemon-log4j2.properties.template
Hive-exec-log4j2.properties.template parquet-logging.properties
Hive-log4j2.properties.template
[Email protected]:/usr/local/hive/hive-2.1.0/conf$CP hive-default.xml.template Hive-site.xml
[Email protected]:/usr/local/hive/hive-2.1.0/conf$

v. Configuring Hive

<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://SparkSingleNode:3306/hive_metadata?createDatabaseIfNotExist=true</value>
<description>
JDBC connect string for a jdbc Metastore.
To use SSL-encrypt/authenticate the connection, provide database-specific SSL flag in the connection URL.
For example, jdbc:postgresql://myhost/db?ssl=true for Postgres database.
</description>

<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>

[Email protected]:/usr/local/hive/hive-2.1.0/conf$ CP hive-env.sh.template hive-env.sh
[Email protected]:/usr/local/hive/hive-2.1.0/conf$ vim hive-env.sh

[Email protected]:/usr/local/hive/hive-2.1.0/bin$ vim hive-config.sh

Export java_home=/usr/local/jdk/jdk1.8.0_60
Export hive_home=/usr/local/hive/hive-2.1.0
Export hadoop_home=/usr/local/hadoop/hadoop-2.6.0

Vim/etc/profile

#hive
Export hive_home=/usr/local/hive/hive-2.1.0
Export path= $PATH: $HIVE _home/bin

Source/etc/profile

Copy the Mysql-connector-java-***.jar into the Hive installation directory under LIB.

[Email protected]:/usr/local/hadoop/hadoop-2.6.0$ sbin/start-all.sh

Install and configure hive-2.1.0 under Ubuntu system

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.