本文主要是介绍Mac M1安装Hive,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、下载解压Hive
1.官网地址
https://dlcdn.apache.org/hive/
2.选择对应版本进行下载,这里我以3.1.3为例;
3.下载好后,进行解压,并重命名为hive-3.1.3,放到资源库目录下;
二、配置系统环境
1.打开~/.bash_profile文件
open -e ~/.bash_profile
2.添加Hadoop、Hive环境变量
export HADOOP_HOME=/Library/hadoop-3.4.0
export PATH=$PATH:$HADOOP_HOME/binexport HIVE_HOME=/Library/hive-3.1.3
export PATH=$HIVE_HOME/bin:$PATH
3.使得配置生效
source ~/.bash_profile
4.停止hadoop并重启
如果hadoop正在运行暂停hadoop
# 进入hadoop目录
cd /Library/hadoop-3.4.0
# 停止hadoop服务
./sbin/stop-all.sh
# 启动hadoop
./sbin/start-all.sh
5.查看hive版本
hive --version
如果出现mac权限问题,解决方法参考链接
hive --versionSLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Library/hive-3.1.3/lib/log4j-slf4j-impl-2.18.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Library/hadoop-3.4.0/libexec/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Lib
这篇关于Mac M1安装Hive的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!