您好,登錄后才能下訂單哦!
這篇文章主要講解了“Hive遠程模式安裝教程”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“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中。網(wǎng)絡(luò)策略上,192.168.33.33要能訪問HADOOP集群。
Hive需要將元數(shù)據(jù)存儲在數(shù)據(jù)庫中,我們使用mysql,搭建mysql略。
1、將Hive安裝包放在/opt下,解壓,之后將mysql的jdbc連接包放在hive/lib下。
2、Hive/conf下,建hive-site.xml文件,文件內(nèi)容如下List-1,hive.metastore.local的值要設(shè)置為false,這樣就會開啟9083端口。List-1中的hivedb我們不需要創(chuàng)建,會自動創(chuàng)建。
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下,創(chuàng)建hive-log4j2.properties文件,內(nèi)容如下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中,之后初始化,執(zhí)行"schematool -dbType mysql -initSchema"
5、啟動元數(shù)據(jù)服務,執(zhí)行"hive --service metastore"
6、啟動hiveserver,執(zhí)行"hiveserver2"
7、瀏覽器訪問192.168.33.33:10002,看Hive的UI,此外可以執(zhí)行jps -m查看。啟動過程中可以查看hive日志,是否報錯。
本文中,我們將Hive 的metastore和hiverserver都在一臺機器上啟動的。
感謝各位的閱讀,以上就是“Hive遠程模式安裝教程”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對Hive遠程模式安裝教程這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。