Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos6.5 installation and deployment Hive

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Premise: the virtual machine can access the Internet, and the hadoop cluster is successfully built and started. Note: the path executed by each line of code.

First, install MySQL

1. Install MySQL yum install mysql-server online

Installation completed

2. Start the MySQL service service mysqld start

3. Set the MySQL root user password

(1) there is no password by default, so just enter MySQL and press enter.

(2) enter the command to set the root password set password for root@localhost=password ('root')

MySQL:

User: root

Password: root

(3), exit (exit;) and log in again (mysql-u root-p)

4. Create hive account.

Account number: hive

Password: hive

(1) create a hive account create user 'hive' identified by' hive'

(2) authorize all permissions of MySQL to hive account grant all on. To 'hive'@'yb'identified by' hive'

(3) to give effect to the above order flush privileges

Then log in to the MySQL database using your hive account to mysql-h yb-u hive-p

(4) create hive database create database hive

Second, install hive

1. Upload and decompress hive

Note: make sure the permission in the red box is hadoop! If root, you can go to root and change the command to hadoop: chown-R hadoop:hadoop apache-hive-1.0.0-bin.tar.gz, and then re-enter hadoop to decompress.

2. Rename apache-hive-1.0.0-bin to hive mv apache-hive-1.0.0-bin hive

3. Modify hive configuration file

Since the hive-site.xml file does not exist, you first need to use the command to make a copy: cp hive-default.xml.template hive-site.xml

(1), modify the configuration file hive-site.xml

The configuration driver connection is called com.mysql.jdbc.Driver

Note: you need to find the corresponding content in the file

Modify the URL of MySQL

Javax.jdo.option.ConnectionURL

Jdbc:mysql://yb:3306/hive

Modify the user name and password of the database

Javax.jdo.option.ConnectionUserName

Hive

Javax.jdo.option.ConnectionPassword

Hive

4. Configure hive environment variable vi / etc/profile

Note: switch to root user

Make the configuration effective source / etc/profile

5. Download mysql-connector-java-5.1.38.jar and upload it to hive's lib directory

Create hive related directories

6. Modify hive-site.xml related files

Hive.querylog.location

/ home/hadoop/app/hive/iotmp

Location of Hive run time structured log file

Hive.exec.local.scratchdir

/ home/hadoop/app/hive/iotmp

Local scratch space for Hive jobs

Hive.downloaded.resources.dir

/ home/hadoop/app/hive/iotmp

Temporary local directory for added resources in the remote file system.

7. Execute the hive script

Note: start the hadoop cluster before execution

8. Check whether hive can

At this point, hive installation is complete!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report