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

Hive remote mode installation tutorial

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

这篇文章主要讲解了"Hive远程模式安装教程",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Hive远程模式安装教程"吧!

Hadoop的版本是2.7.2,Hive的版本是2.1.1,版本要对应。

Hadoop的安装略,JDK的安装略。安装在192.168.33.33这台机器上。

首先安装JDK,略。

之后将Hadoop集群上的hadoop包拷贝到192.168.33.33,将HADOOP_HOME加入到PATH中。网络策略上,192.168.33.33要能访问HADOOP集群。

Hive需要将元数据存储在数据库中,我们使用mysql,搭建mysql略。

1、将Hive安装包放在/opt下,解压,之后将mysql的jdbc连接包放在hive/lib下。

2、Hive/conf下,建hive-site.xml文件,文件内容如下List-1,hive.metastore.local的值要设置为false,这样就会开启9083端口。List-1中的hivedb我们不需要创建,会自动创建。

List-1

javax.jdo.option.ConnectionURL jdbc:mysql://mysqlhost:3306/hivedb?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName root javax.jdo.option.ConnectionPassword mysql的密码 hive.metastore.schema.verification false hive.metastore.warehouse.dir /user/hive/warehouse hive.metastore.local false

3、hive/conf下,创建hive-log4j2.properties文件,内容如下List-2

List-2

status = INFOname = HiveLog4j2packages = org.apache.hadoop.hive.ql.log# list of propertiesproperty.hive.log.level = INFOproperty.hive.root.logger = DRFA# hive的日志路径property.hive.log.dir = /opt/hive/logsproperty.hive.log.file = hive.logproperty.hive.perflogger.log.level = INFO# list of all appendersappenders = console, DRFA# console appenderappender.console.type = Consoleappender.console.name = consoleappender.console.target = SYSTEM_ERRappender.console.layout.type = PatternLayoutappender.console.layout.pattern = %d{ISO8601} %5p [%t] %c{2}: %m%n# daily rolling file appenderappender.DRFA.type = RollingRandomAccessFileappender.DRFA.name = DRFAappender.DRFA.fileName = ${sys:hive.log.dir}/${sys:hive.log.file}# Use %pid in the filePattern to append @ to the filename if you want separate log files for different CLI sessionappender.DRFA.filePattern = ${sys:hive.log.dir}/${sys:hive.log.file}.%d{yyyy-MM-dd}appender.DRFA.layout.type = PatternLayoutappender.DRFA.layout.pattern = %d{ISO8601} %5p [%t] %c{2}: %m%nappender.DRFA.policies.type = Policiesappender.DRFA.policies.time.type = TimeBasedTriggeringPolicyappender.DRFA.policies.time.interval = 1appender.DRFA.policies.time.modulate = trueappender.DRFA.strategy.type = DefaultRolloverStrategyappender.DRFA.strategy.max = 30# list of all loggersloggers = NIOServerCnxn, ClientCnxnSocketNIO, DataNucleus, Datastore, JPOX, PerfLoggerlogger.NIOServerCnxn.name = org.apache.zookeeper.server.NIOServerCnxnlogger.NIOServerCnxn.level = WARNlogger.ClientCnxnSocketNIO.name = org.apache.zookeeper.ClientCnxnSocketNIOlogger.ClientCnxnSocketNIO.level = WARNlogger.DataNucleus.name = DataNucleuslogger.DataNucleus.level = ERRORlogger.Datastore.name = Datastorelogger.Datastore.level = ERRORlogger.JPOX.name = JPOXlogger.JPOX.level = ERRORlogger.PerfLogger.name = org.apache.hadoop.hive.ql.log.PerfLoggerlogger.PerfLogger.level = ${sys:hive.perflogger.log.level}# root loggerrootLogger.level = ${sys:hive.log.level}rootLogger.appenderRefs = rootrootLogger.appenderRef.root.ref = ${sys:hive.root.logger}

4、将HIVE_HOME加入到PATH中,之后初始化,执行"schematool -dbType mysql -initSchema"

5、启动元数据服务,执行"hive --service metastore"

6、启动hiveserver,执行"hiveserver2"

7、浏览器访问192.168.33.33:10002,看Hive的UI,此外可以执行jps -m查看。启动过程中可以查看hive日志,是否报错。

本文中,我们将Hive 的metastore和hiverserver都在一台机器上启动的。

感谢各位的阅读,以上就是"Hive远程模式安装教程"的内容了,经过本文的学习后,相信大家对Hive远程模式安装教程这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

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