下载地址:Index of /dist/hive
1)把apache-hive-3.1.3-bin.tar.gz利用Xshell/FinalShell上传至opt/software目录下
2)解压apache-hive-3.1.3-bin.tar.gz
tar -zxvf /opt/software/apache-hive-3.1.3-bin.tar.gz -C /opt/module/
3)修改apache-hive-3.1.3-bin.tar.gz的名称为hive
mv /opt/module/apache-hive-3.1.3-bin/ /opt/module/hive
4)修改/etc/profile.d/my_env.sh,添加环境变量
sudo vim /etc/profile.d/my_env.sh
添加一下内容:
#HIVE_HOME
export HIVE_HOME=/opt/module/hive
export PATH=$PATH:$HIVE_HOME/bin
刷新一下:
source /etc/profile.d/my_env.sh
5)初始化元数据库(默认是derby数据库)
注:进入hive目录下执行以下命令
bin/schematool -dbType derby -initSchema
6) 启动Hive
bin/hive
最后成功启动hive后,通过以下命令验证一下
hive> show databases;
hive> show tables;
hive> create table stu(id int, name string);
hive> insert into stu values(1,"ss");
hive> select * from stu;
版权声明:本文为weixin_64443786原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。