环境准备
java: 1.8
maven: 3.6.0
hive源码: https://hive.apache.org/
idea: 2021版
win: 家庭版(其他版本还没测试)
hive版本:3.1.2
说明:以下只针对win环境
1.改pom文件
hive-common模块;
<target>
<exec executable="cmd" failonerror="true">
<arg value="/c"/>
<arg value="${basedir}/src/scripts/saveVersion.sh"/>
<arg value="${project.version}"/>
<arg value="${hive.version.shortname}"/>
<arg value="${basedir}/src"/>
</exec>
</target>
hive-standalone-metastore模块:
<target>
<exec executable="cmd" failonerror="true">
<arg value="/c"/>
<arg value="${basedir}/src/main/resources/saveVersion.sh"/>
<arg value="${project.version}"/>
<arg value="${hive.version.shortname}"/>
<arg value="${basedir}/src"/>
</exec>
</target>
这里还待考究,使用win环境下c参数处理shell脚本问题--这里cmd在源代码应该对应着bash--如果你使用linux编译或者类shell工具可以忽略。
2.idea中jdk环境不足问题
问题描述:
java: 程序包com.sun.tools.javac.util不存在
添加jdk中的tools包,启动hivecli时命令交互需要,
3.测试hive-cli模块
3.1预处理
将hive-cli模块的pom文件中包的引用换掉
<!-- <scope>test</scope>-->
里边所有的test域都去掉.-如上边处理
3.2创建hive-site.xml文件
这里把你hive配置拿过来
3.3元数据问题处理
<!-- hive源数据库 -->
<property>
<name>hive.metastore.uris</name>
<value>thrift://主机名或者ip:9083</value>
</property>
在这个模块中的刚刚创建的hive-site.xml中添加这个。
3.4启动hive元数据外部系统访问
[user@hive~]$ hive --service metastore
元数据访问问题,后续有时间更新--这个只是一中
4.使用idea进行install
install完成后启动hcli
5.最终效果
5.问题
如果出现包存在但是一直不报错,或者启动上边hcli报找不到包问题,关了idea再打开
如果你还有其他问题--你自己处理吧或者你发个言我看看啥
有缘人点个赞吧
easy up. easy down. due to death. never long.