Hadoop-08-hive Local stand-alone installation

Source: Internet
Author: User

1. install mysql

sudo apt-get install mysql-server mysql-client

2. Log in to the MySQL database using the root account and create a new database that holds the hive metadata, assuming it is called hivedb.

A) Mysql-uroot-proot

b) Create database hivedb;

3. Log in to MySQLusing the root accountand create a new hive connection to MySQL account and grant permissions

A) grant all privileges the hive.* to [e-mail protected] identified by ' Hive ';

b) flush privileges;

If you want to specify partial permissions to a user, you can write:
Mysql>grant select,update on phplampdb.* to [e-mail protected] identified by ' 1234 ';
Refreshes the System permissions table.
Mysql>flush privileges;

Mysql> grant permissions 1, permissions 2,... Permission n on the database name. Table name to User name @ user address identified by ' connection password ';

4. Download and unzip the installation hive-0.8.1

5. Copy the Mysql-connector-java.bin.jar to the lib in the Hive installation directory Subdirectories (Don't forget!!!) )

6. Modify the hive-env.sh in the bin directory under the hive directory , Add at the end:

Export Java_home= ....

e xport hadoop_home= ...

7. Enter the conf directory under the Hive installation directory , according to hive-default.xml.template Copy out two files :

C P hive-default.xml.template hive-default.xml

C P hive-default.xml.template hive-site.xml

8. Configure hive-site.xml:

<property>

<name> Hive.metastore.warehouse.dir </name>

<value>/home/hadoop/hive-0.8.1/data</value>

</property>

<property>

<name> Hive.exec.scratchdir </name>

<value>/home/hadoop/hive-0.8.1/tmp</value>

</property>

<property>

<name> Javax.jdo.option.ConnectionURL </name>

<value>jdbc:mysql://localhost:3306/hiveDB?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>hive</value>

</property>

<property>

<name> Javax.jdo.option.ConnectionPassword </name>

<value>hive</value>

</property>

9. start the Hadoop cluster before starting hive .


start hive. The hive installation path can be added in /etc/profile for ease of use.

After startup, use the hive command to verify that the system is as follows:

h ive> CREATE TABLE test (ID int primary key auto_increment,name varchar);

Enter the hivedb database under mysql and use the show Tables command to view the corresponding metadata table .

One. Open the hive hwi service ./hive--service hwito see if the system service is open properly, enter the following command:

Hive--service Hwi

Enter hwi corresponding URLin IE ,http://localhost:9999/hwi, You can view the hive related information.

Make sure the HIVE installation is up and running!


Hadoop-08-hive Local stand-alone installation

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.