1、下载apache-hive-1.2.1-bin.tar.gz(下载地址:http://archive.apache.org/dist/hive/)
2、把 apache-hive-1.2.1-bin.tar.gz 上传到 linux 的/opt/software 目录下
但是最开始/opt下面没完software这个文件夹,我自行创建的可以?(可以)
easonl@easonl-Lenovo-IdeaPad-S400:/opt$ sudo mkdir software
[sudo] easonl 的密码:
easonl@easonl-Lenovo-IdeaPad-S400:/opt$ ls
hadoop-2.7.2 hadoop-2.7.2.tar.gz software
easonl@easonl-Lenovo-IdeaPad-S400:/opt$
继续把apache-hive-1.2.1-bin.tar.gz 上传到 linux 的/opt/software 目录下
root@easonl-Lenovo-IdeaPad-S400:/home/easonl/download/software# ls
apache-hive-1.2.1-bin.tar.gz linuxqq_2.0.0-b2-1089_amd64.deb
hadoop-2.7.2.tar.gz
root@easonl-Lenovo-IdeaPad-S400:/home/easonl/download/software# cp apache-hive-1.2.1-bin.tar.gz /opt/software
检查拷贝成功
easonl@easonl-Lenovo-IdeaPad-S400:/$ cd /opt/software
easonl@easonl-Lenovo-IdeaPad-S400:/opt/software$ ls
apache-hive-1.2.1-bin.tar.gz
并且/opt文件下也没有/module/,自行创建可以?(可以)
easonl@easonl-Lenovo-IdeaPad-S400:/opt$ sudo mkdir module
[sudo] easonl 的密码:
easonl@easonl-Lenovo-IdeaPad-S400:/opt$ ls
hadoop-2.7.2 hadoop-2.7.2.tar.gz module software
3、解压apache-hive-1.2.1-bin.tar.gz 到/opt/module/目录下面
easonl@easonl-Lenovo-IdeaPad-S400:/opt/software$ sudo su
[sudo] easonl 的密码:
root@easonl-Lenovo-IdeaPad-S400:/opt/software# who
easonl tty7 2021-03-28 04:57 (:0)
root@easonl-Lenovo-IdeaPad-S400:/opt/software# whoami
root
root@easonl-Lenovo-IdeaPad-S400:/opt/software# ll
总用量 90668
drwxr-xr-x 2 root root 4096 3月 28 10:58 ./
drwxr-xr-x 5 root root 4096 3月 28 11:11 ../
-rw-r--r-- 1 root root 92834839 3月 28 10:58 apache-hive-1.2.1-bin.tar.gz
root@easonl-Lenovo-IdeaPad-S400:/opt/software# tar -zxvf apache-hive-1.2.1-bin.tar.gz -C /opt/module/
4、修改 apache-hive-1.2.1-bin.tar.gz 的名称为 hive
root@easonl-Lenovo-IdeaPad-S400:/opt# cd module
root@easonl-Lenovo-IdeaPad-S400:/opt/module# ls
apache-hive-1.2.1-bin hadoop-2.7.2 os.path
fb303.FacebookService hive_metastore.ThriftHiveMetastore queryplan.ttypes
fb303.ttypes hive_metastore.ttypes
root@easonl-Lenovo-IdeaPad-S400:/opt/module# mv apache-hive-1.2.1-bin/ hive
root@easonl-Lenovo-IdeaPad-S400:/opt/module# ls
fb303.FacebookService hive os.path
fb303.ttypes hive_metastore.ThriftHiveMetastore queryplan.ttypes
hadoop-2.7.2 hive_metastore.ttypes
root@easonl-Lenovo-IdeaPad-S400:/opt/module#
修改/opt/module/hive/conf 目录下的 hive-env.sh.template 名称为 hive-env.sh
root@easonl-Lenovo-IdeaPad-S400:/opt/module/hive/conf# mv hive-env.sh.template hive-env.sh
root@easonl-Lenovo-IdeaPad-S400:/opt/module/hive/conf# ll
总用量 196
drwxr-xr-x 2 root root 4096 3月 28 19:34 ./
drwxr-xr-x 8 root root 4096 3月 28 16:10 ../
-rw-rw-r-- 1 root root 1139 4月 30 2015 beeline-log4j.properties.template
-rw-rw-r-- 1 root root 168431 6月 19 2015 hive-default.xml.template
-rw-rw-r-- 1 root root 2378 4月 30 2015 hive-env.sh
-rw-rw-r-- 1 root root 2662 4月 30 2015 hive-exec-log4j.properties.template
-rw-rw-r-- 1 root root 3050 4月 30 2015 hive-log4j.properties.template
-rw-rw-r-- 1 root root 1593 4月 30 2015 ivysettings.xml
root@easonl-Lenovo-IdeaPad-S400:/opt/module/hive/conf#
5、进入 hive/conf ,目录并修改 hive-env.sh 文件,添加下面信息
export HADOOP_HOME=/opt/module/hadoop-2.7.2
export HIVE_CONF_DIR=/opt/module/hive/conf
6、运行hive,但是到这报错
root@easonl-Lenovo-IdeaPad-S400:/opt/module/hive# bin/hive
/opt/module/hadoop-2.7.2/bin/hadoop: 行 166: /opt/module/JDK1.8/bin/java: 没有那个文件或目录
Unable to determine Hadoop version information.
'hadoop version' returned:
/opt/module/hadoop-2.7.2/bin/hadoop: 行 166: /opt/module/JDK1.8/bin/java: 没有那个文件或目录
1211111