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

The process of quickly configuring hive in centos7

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

This article mainly introduces "the process of rapid configuration of hive by centos7". In daily operation, I believe many people have doubts about the process of rapid configuration of hive by centos7. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "the process of rapid configuration of hive by centos7". Next, please follow the editor to study!

# hive configuration

Catalogue planning

/ usr/lib/jvm/jdk1.8.0_65

/ usr/hadoop

/ usr/hive

/ etc/profile

.

Export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_131

Export JRE_HOME=$ {JAVA_HOME} / jre

Export CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib

Export PATH=$ {JAVA_HOME} / bin:$PATH

Export HADOOP_HOME=/usr/hadoop

Export PATH=$ {HADOOP_HOME} / bin:$ {HADOOP_HOME} / sbin:$PATH

Export HIVE_HOME=/usr/hive

Export PATH=$HIVE_HOME/bin:$PATH

Export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server

If this is not available, it will OGG-15050 Error loading Java VM runtime library: (2 No such file or directory)

Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib

Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib

Export OGG_HOME=/ogg/oggbd

# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OGG_HOME:$OGG_HOME/ggjava

Download and decompress

Hive download address: http://hive.apache.org/-- > GENERAL-- > Downloads

Apache-hive-2.3.0-bin.tar.gz

Tar-xzf apache-hive-2.3.0-bin.tar.gz

Mv apache-hive-2.3.0-bin / usr/hive

Chown-R htjs:htjs / usr/hive

Enter / usr/hive/conf copy and modify configuration file

Configuration file

Profile 1 hive-env.sh

Cp hive-env.sh.template hive-env.sh

Modify HADOOP_HOME:HADOOP_HOME=/usr/hadoop

Hive cannot initialize metadata if it is not modified here

Error: Syntax error: Encountered "" at line 1, column 64. (state=42X01,code=30000)

Profile 2 hive-site.xml

Cp hive-default.xml.template hive-site.xml

Cp hive-log4j2.properties.template hive-log4j2.properties

Cp hive-exec-log4j2.properties.template hive-exec-log4j2.properties

The mysql related section of the hive-site.xml configuration file (this place is not fully displayed on the blog! )

Javax.jdo.option.ConnectionURL

Jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true

Javax.jdo.option.ConnectionDriverName

Com.mysql.jdbc.Driver

Javax.jdo.option.ConnectionUserName

Root

Javax.jdo.option.ConnectionPassword

Rootroot

Replacement of tmpdir in hive-site.xml configuration file

:% system:java.io.tmpdir ${system:java.io.tmpdir} /\ / usr\ / hive\ / tmp/gc

:% sax ${system:user.name} / htjs/gc

In fact, it will

${system:java.io.tmpdir} / ${system:user.name}

Replace with

/ usr/hive/tmp/htjs

If you do not replace it here, there will be an error that hive cannot start URISyntaxException

Copy mysql driver

Tar-xzf mysql-connector-java-5.1.42.tar.gz

Cd mysql-connector-java-5.1.42

Cp mysql-connector-java-5.1.42-bin.jar / usr/hive/lib

Chown-R htjs:htjs / usr/hive/lib/mysql*.jar

Create a directory

Mkdir / usr/hive/tmp

Hdfs dfs-mkdir / tmp

Hdfs dfs-mkdir-p / user/hive/warehouse

Hdfs dfs-chmod-R + w / tmp

Hdfs dfs-chmod-R + w / user/hive

Hdfs dfs-ls / user/hive

Initialize schema

$$HIVE_HOME/bin/schematool-dbType mysql-initSchema

Run hive

Stand-alone mode

$hive

Hive > CREATE TABLE pokes (foo INT, bar STRING)

Hive > CREATE TABLE invites (foo INT, bar STRING) PARTITIONED BY (ds STRING)

Server mode

$hiveserver2

Or

$nohup / usr/hive/bin/hiveserver2 &

At this point, you can access hive through the jdbc client connection to this service. The default port is 10000.

You can change hive.server2.thrift.port to other ports in hive-site.xml, such as 8338

Connect using beeline

$beeline-u jdbc:hive2://node1:10000-n "htjs"

The-n "htjs" option is used to avoid permission issues. If there is a problem with / user/hive/warehouse that cannot be written, take-n

Insert into pokes (foo,bar) values (1)

Select * from pokes

Hive configuration is complete.

At this point, the study on "the process of quickly configuring hive by centos7" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Network Security

Wechat

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

12
Report