hadoop3下配置hive3.0.0详细过程步骤

tech2024-01-05  68

安装好hadoop3之后就需要安装hive了。在安装之前,需要了解清楚准备步骤和版本对应问题。 在安装hive之前需要先安装mysql或者mariadb,两者之间的区别及共性在此不做赘述。 关于版本对应问题,需要了解的是不同的hadoop版本所配置的hive,hbase等工具的版本是不同的,hive版本对应可以参考Hive:http://hive.apache.org/downloads.html,hbase版本对应可以参考这里HBase:http://hbase.apache.org/book.html#java,而在查询之后我得知我的版本对应关系应如下: Hadoop:3.2.1 Hive:3.0.0及以上 HBase:2.2.x,2.3.x Zookeeper:3.4.10及以上 Spark:2.3.x及以上 了解清楚后这里是主要步骤:

#mermaid-svg-w3IJsjYciGdUn0dJ .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .label text{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .node rect,#mermaid-svg-w3IJsjYciGdUn0dJ .node circle,#mermaid-svg-w3IJsjYciGdUn0dJ .node ellipse,#mermaid-svg-w3IJsjYciGdUn0dJ .node polygon,#mermaid-svg-w3IJsjYciGdUn0dJ .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-w3IJsjYciGdUn0dJ .node .label{text-align:center;fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .node.clickable{cursor:pointer}#mermaid-svg-w3IJsjYciGdUn0dJ .arrowheadPath{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-w3IJsjYciGdUn0dJ .flowchart-link{stroke:#333;fill:none}#mermaid-svg-w3IJsjYciGdUn0dJ .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-w3IJsjYciGdUn0dJ .edgeLabel rect{opacity:0.9}#mermaid-svg-w3IJsjYciGdUn0dJ .edgeLabel span{color:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-w3IJsjYciGdUn0dJ .cluster text{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-w3IJsjYciGdUn0dJ .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-w3IJsjYciGdUn0dJ text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-w3IJsjYciGdUn0dJ .actor-line{stroke:grey}#mermaid-svg-w3IJsjYciGdUn0dJ .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-w3IJsjYciGdUn0dJ #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .sequenceNumber{fill:#fff}#mermaid-svg-w3IJsjYciGdUn0dJ #sequencenumber{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ #crosshead path{fill:#333;stroke:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .messageText{fill:#333;stroke:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-w3IJsjYciGdUn0dJ .labelText,#mermaid-svg-w3IJsjYciGdUn0dJ .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-w3IJsjYciGdUn0dJ .loopText,#mermaid-svg-w3IJsjYciGdUn0dJ .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-w3IJsjYciGdUn0dJ .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-w3IJsjYciGdUn0dJ .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-w3IJsjYciGdUn0dJ .noteText,#mermaid-svg-w3IJsjYciGdUn0dJ .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-w3IJsjYciGdUn0dJ .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-w3IJsjYciGdUn0dJ .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-w3IJsjYciGdUn0dJ .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-w3IJsjYciGdUn0dJ .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .section{stroke:none;opacity:0.2}#mermaid-svg-w3IJsjYciGdUn0dJ .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-w3IJsjYciGdUn0dJ .section2{fill:#fff400}#mermaid-svg-w3IJsjYciGdUn0dJ .section1,#mermaid-svg-w3IJsjYciGdUn0dJ .section3{fill:#fff;opacity:0.2}#mermaid-svg-w3IJsjYciGdUn0dJ .sectionTitle0{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .sectionTitle1{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .sectionTitle2{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .sectionTitle3{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-w3IJsjYciGdUn0dJ .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .grid path{stroke-width:0}#mermaid-svg-w3IJsjYciGdUn0dJ .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-w3IJsjYciGdUn0dJ .task{stroke-width:2}#mermaid-svg-w3IJsjYciGdUn0dJ .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .taskText:not([font-size]){font-size:11px}#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-w3IJsjYciGdUn0dJ .task.clickable{cursor:pointer}#mermaid-svg-w3IJsjYciGdUn0dJ .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-w3IJsjYciGdUn0dJ .taskText0,#mermaid-svg-w3IJsjYciGdUn0dJ .taskText1,#mermaid-svg-w3IJsjYciGdUn0dJ .taskText2,#mermaid-svg-w3IJsjYciGdUn0dJ .taskText3{fill:#fff}#mermaid-svg-w3IJsjYciGdUn0dJ .task0,#mermaid-svg-w3IJsjYciGdUn0dJ .task1,#mermaid-svg-w3IJsjYciGdUn0dJ .task2,#mermaid-svg-w3IJsjYciGdUn0dJ .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutside0,#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutside2{fill:#000}#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutside1,#mermaid-svg-w3IJsjYciGdUn0dJ .taskTextOutside3{fill:#000}#mermaid-svg-w3IJsjYciGdUn0dJ .active0,#mermaid-svg-w3IJsjYciGdUn0dJ .active1,#mermaid-svg-w3IJsjYciGdUn0dJ .active2,#mermaid-svg-w3IJsjYciGdUn0dJ .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-w3IJsjYciGdUn0dJ .activeText0,#mermaid-svg-w3IJsjYciGdUn0dJ .activeText1,#mermaid-svg-w3IJsjYciGdUn0dJ .activeText2,#mermaid-svg-w3IJsjYciGdUn0dJ .activeText3{fill:#000 !important}#mermaid-svg-w3IJsjYciGdUn0dJ .done0,#mermaid-svg-w3IJsjYciGdUn0dJ .done1,#mermaid-svg-w3IJsjYciGdUn0dJ .done2,#mermaid-svg-w3IJsjYciGdUn0dJ .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-w3IJsjYciGdUn0dJ .doneText0,#mermaid-svg-w3IJsjYciGdUn0dJ .doneText1,#mermaid-svg-w3IJsjYciGdUn0dJ .doneText2,#mermaid-svg-w3IJsjYciGdUn0dJ .doneText3{fill:#000 !important}#mermaid-svg-w3IJsjYciGdUn0dJ .crit0,#mermaid-svg-w3IJsjYciGdUn0dJ .crit1,#mermaid-svg-w3IJsjYciGdUn0dJ .crit2,#mermaid-svg-w3IJsjYciGdUn0dJ .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-w3IJsjYciGdUn0dJ .activeCrit0,#mermaid-svg-w3IJsjYciGdUn0dJ .activeCrit1,#mermaid-svg-w3IJsjYciGdUn0dJ .activeCrit2,#mermaid-svg-w3IJsjYciGdUn0dJ .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-w3IJsjYciGdUn0dJ .doneCrit0,#mermaid-svg-w3IJsjYciGdUn0dJ .doneCrit1,#mermaid-svg-w3IJsjYciGdUn0dJ .doneCrit2,#mermaid-svg-w3IJsjYciGdUn0dJ .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-w3IJsjYciGdUn0dJ .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-w3IJsjYciGdUn0dJ .milestoneText{font-style:italic}#mermaid-svg-w3IJsjYciGdUn0dJ .doneCritText0,#mermaid-svg-w3IJsjYciGdUn0dJ .doneCritText1,#mermaid-svg-w3IJsjYciGdUn0dJ .doneCritText2,#mermaid-svg-w3IJsjYciGdUn0dJ .doneCritText3{fill:#000 !important}#mermaid-svg-w3IJsjYciGdUn0dJ .activeCritText0,#mermaid-svg-w3IJsjYciGdUn0dJ .activeCritText1,#mermaid-svg-w3IJsjYciGdUn0dJ .activeCritText2,#mermaid-svg-w3IJsjYciGdUn0dJ .activeCritText3{fill:#000 !important}#mermaid-svg-w3IJsjYciGdUn0dJ .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-w3IJsjYciGdUn0dJ g.classGroup text .title{font-weight:bolder}#mermaid-svg-w3IJsjYciGdUn0dJ g.clickable{cursor:pointer}#mermaid-svg-w3IJsjYciGdUn0dJ g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-w3IJsjYciGdUn0dJ g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-w3IJsjYciGdUn0dJ .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-w3IJsjYciGdUn0dJ .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-w3IJsjYciGdUn0dJ .dashed-line{stroke-dasharray:3}#mermaid-svg-w3IJsjYciGdUn0dJ #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ .commit-id,#mermaid-svg-w3IJsjYciGdUn0dJ .commit-msg,#mermaid-svg-w3IJsjYciGdUn0dJ .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-w3IJsjYciGdUn0dJ g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-w3IJsjYciGdUn0dJ g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-w3IJsjYciGdUn0dJ g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-w3IJsjYciGdUn0dJ .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-w3IJsjYciGdUn0dJ .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-w3IJsjYciGdUn0dJ .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-w3IJsjYciGdUn0dJ .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-w3IJsjYciGdUn0dJ .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-w3IJsjYciGdUn0dJ .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-w3IJsjYciGdUn0dJ .edgeLabel text{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-w3IJsjYciGdUn0dJ .node circle.state-start{fill:black;stroke:black}#mermaid-svg-w3IJsjYciGdUn0dJ .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-w3IJsjYciGdUn0dJ #statediagram-barbEnd{fill:#9370db}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-state .divider{stroke:#9370db}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-w3IJsjYciGdUn0dJ .note-edge{stroke-dasharray:5}#mermaid-svg-w3IJsjYciGdUn0dJ .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-w3IJsjYciGdUn0dJ .error-icon{fill:#522}#mermaid-svg-w3IJsjYciGdUn0dJ .error-text{fill:#522;stroke:#522}#mermaid-svg-w3IJsjYciGdUn0dJ .edge-thickness-normal{stroke-width:2px}#mermaid-svg-w3IJsjYciGdUn0dJ .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-w3IJsjYciGdUn0dJ .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-w3IJsjYciGdUn0dJ .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-w3IJsjYciGdUn0dJ .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-w3IJsjYciGdUn0dJ .marker{fill:#333}#mermaid-svg-w3IJsjYciGdUn0dJ .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-w3IJsjYciGdUn0dJ { color: rgba(0, 0, 0, 0.75); font: ; } 下载安装mariadb 下载解压hive 配置路径和文件 调整guava.jar版本 下载配置mariadb-jdbc驱动 初始化 启动hive

一、下载安装mariadb 本文使用的是centos 7.7版本,安装mariadb 5.5.65版本。安装过程步骤,可以参考这篇博文Centos7 下Mariadb 安装及权限设置

二、下载解压hive 在master节点上安装hive,下载地址:http://archive.apache.org/dist/hive/hive-3.0.0/下载到/usr/local完毕后解压,修改目录名

[root@master local]# tar -xzvf apache-hive-3.0.0-bin.tar.gz [root@master local]# mv apache-hive-3.0.0-bin hive-3.0.0

三、配置路径及文件 1.创建以下目录:

[root@master ~]# mkdir /root/hive/iotmp

2.配置全局路径

[root@master ~]# vim /etc/profile

将以下路径追加到文件末尾后保存

export HIVE_HOME=/usr/local/hive-3.0.0 export PATH=$PATH:$HIVE_HOME/bin

使其生效

[root@master ~]# source /etc/profile

3.配置文件hive-env.sh 切换到目录,从模板复制用以配置

[root@master ~]# cd /usr/local/hive-3.0.0/conf [root@master conf]# cp hive-env.sh.template hive-env.sh

将以下内容追加至文件后保存

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre export HADOOP_HOME=/usr/local/hadoop-3.2.1 export HIVE_HOME=/usr/local/hive-3.0.0 export HIVE_CONF_DIR=/usr/local/hive-3.0.0/conf

4.配置文件hive-site.xml

[root@master conf]# cp hive-default.xml.template hive-site.xml

编辑文件hive-site.xml,将以下内容中的value值替换掉文件原本的默认值,可以在命令模式下输入name值进行查找。

#逐个替换 <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://master:3306/hive?createDatabaseIfNotExist=true</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>org.mariadb.jdbc.Driver</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>123456</value> </property> <property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> #会在hdfs生成相应路径 </property> <property> <name>hive.exec.scratchdir</name> <value>/user/hive/tmp</value> #会在hdfs生成相应路径 </property> <property> <name>hive.querylog.location</name> <value>/user/hive/log</value> </property> <property> <name>hive.exec.local.scratchdir</name> <value>/root/hive/iotmp</value> <description>Local scratch space for Hive jobs</description> </property> <property> <name>hive.downloaded.resources.dir</name> <value>/root/hive/iotmp</value> <description>Temporary local directory for added resources in the remote file system.</description> </property>

注:javax.jdo.option.ConnectionDriverName是对应数据库的jdbc驱动,如果数据库是mysql则值为com.mysql.jdbc.Driver,若数据库是mariadb则值为org.mariadb.jdbc.Driver 修改完后查找值这个非法字符并删掉,保存文件。 4.配置log4j2文件 直接从模板拷贝出来即可

[root@master conf]# cp hive-exec-log4j2.properties.template hive-exec-log4j2.properties [root@master conf]# cp hive-log4j2.properties.template hive-log4j2.properties

四、配置guava.jar文件 参考到这篇博客hive环境搭建提示: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument 比对/usr/local/hive-3.0.0/lib里的guava.jar和/usr/local/hadoop-3.2.1/share/hadoop/common/lib里的guava.jar的版本,统一使用新的版本。

五、下载配置mariadb-jdbc驱动 下载地址:https://downloads.mariadb.org/connector-java/,下载好后拷贝到/usr/local/hive-3.0.0/lib里。

六、初始化 输入命令

[root@master lib]# schematool -dbType mysql -initSchema

若成功,将会在运行末尾出现 七、启动hive 先将hadoop3的master节点和slave节点均启动,然后在/usr/local/hive-3.0.0/bin目录下执行

[root@master bin]# ./hive

若成功则会出现 退出hive的命令为quit; 进入mysql后可以看到新增加了hive库 至此已完成在hadoop3上配置hive3.0.0

总结:安装的过程中遇到不少bug,除了查看其它博客,还需要保持自己的思路,找到能解决目前问题的办法。

最新回复(0)