您好,登录后才能下订单哦!
这篇文章主要讲解了“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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://mysqlhost: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>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>mysql的密码</value> </property> <property> <name>hive.metastore.schema.verification</name> <value>false</value> </property> <property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </property> <property> <name>hive.metastore.local</name> <value>false</value> </property> </configuration>
3、hive/conf下,创建hive-log4j2.properties文件,内容如下List-2
List-2
status = INFO name = HiveLog4j2 packages = org.apache.hadoop.hive.ql.log # list of properties property.hive.log.level = INFO property.hive.root.logger = DRFA # hive的日志路径 property.hive.log.dir = /opt/hive/logs property.hive.log.file = hive.log property.hive.perflogger.log.level = INFO # list of all appenders appenders = console, DRFA # console appender appender.console.type = Console appender.console.name = console appender.console.target = SYSTEM_ERR appender.console.layout.type = PatternLayout appender.console.layout.pattern = %d{ISO8601} %5p [%t] %c{2}: %m%n # daily rolling file appender appender.DRFA.type = RollingRandomAccessFile appender.DRFA.name = DRFA appender.DRFA.fileName = ${sys:hive.log.dir}/${sys:hive.log.file} # Use %pid in the filePattern to append <process-id>@<host-name> to the filename if you want separate log files for different CLI session appender.DRFA.filePattern = ${sys:hive.log.dir}/${sys:hive.log.file}.%d{yyyy-MM-dd} appender.DRFA.layout.type = PatternLayout appender.DRFA.layout.pattern = %d{ISO8601} %5p [%t] %c{2}: %m%n appender.DRFA.policies.type = Policies appender.DRFA.policies.time.type = TimeBasedTriggeringPolicy appender.DRFA.policies.time.interval = 1 appender.DRFA.policies.time.modulate = true appender.DRFA.strategy.type = DefaultRolloverStrategy appender.DRFA.strategy.max = 30 # list of all loggers loggers = NIOServerCnxn, ClientCnxnSocketNIO, DataNucleus, Datastore, JPOX, PerfLogger logger.NIOServerCnxn.name = org.apache.zookeeper.server.NIOServerCnxn logger.NIOServerCnxn.level = WARN logger.ClientCnxnSocketNIO.name = org.apache.zookeeper.ClientCnxnSocketNIO logger.ClientCnxnSocketNIO.level = WARN logger.DataNucleus.name = DataNucleus logger.DataNucleus.level = ERROR logger.Datastore.name = Datastore logger.Datastore.level = ERROR logger.JPOX.name = JPOX logger.JPOX.level = ERROR logger.PerfLogger.name = org.apache.hadoop.hive.ql.log.PerfLogger logger.PerfLogger.level = ${sys:hive.perflogger.log.level} # root logger rootLogger.level = ${sys:hive.log.level} rootLogger.appenderRefs = root rootLogger.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远程模式安装教程这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。