赞
踩
1)Hive官网地址
http://hive.apache.org/
2)文档查看地址
https://cwiki.apache.org/confluence/display/Hive/GettingStarted
3)下载地址
http://archive.apache.org/dist/hive/
4)github地址
https://github.com/apache/hive
1.Hive 组件需要基于 Hadoop 系统进行安装。因此,在安装 Hive 组件前,需要确保 Hadoop 系统能够正常运行。
2.把 apache-hive-3.1.2-bin.tar.gz
上传到Linux。
3.关闭 Linux 系统防火墙,并将防火墙设定为系统开机并不自动启动。
[root@master ~]# systemctl stop firewalld
[root@master ~]# systemctl disable firewalld
1.使用 root 用户,将 Hive 安装包 /opt/software/apache-hive-2.0.0-bin.tar.gz 路解压到/usr/local/src 路径下。
[root@master ~]# tar -zxvf /opt/software/apache-hive-2.0.0-bin.tar.gz -C /usr/local/src
2.将解压后的 apache-hive-2.0.0-bin 文件夹更名为 hive。
[root@master ~]# mv /usr/local/src/apache-hive-2.0.0-bin /usr/local/src/hive
3.将hive 目录归属用户和用户组为 hadoop。
[root@master ~]# chown -R hadoop:hadoop /usr/local/src/hive
[root@master ~]# rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
[root@master ~]# rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
[root@master ~]# rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
#如果失败先查看自己是否有其他数据库并卸载。
[root@master ~]# rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
default-storage-engine=innodb
innodb_file_per_table
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
[root@master ~]# systemctl start mysqld
[root@master ~]# systemctl status mysqld
[root@master ~]# cat /var/log/mysqld.log | grep password
[root@master ~]#mysql_secure_installation
输入上面获得的密码:ohUliVenh0(z (密码是随机生成的)
输入新的密码(两次)
输入y,然后再输入两次密码。
后面输入两次y一次n,后又两次y。
[root@master ~]# mysql -uroot -p #进入数据库
Enter password: # 输入新设定的密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.18 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>grant all privileges on *.* to root@'localhost' identified by 'Password123$'; # 添加 root 用户本地访问授权
Query OK, 0 rows affected, 1 warning (0.01 sec)mysql> grant all privileges on *.* to root@'%' identified by 'Password123$'; # 添加 root 用户远程访问授权
Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> flush privileges; # 刷新授权
Query OK, 0 rows affected (0.00 sec)mysql> select user,host from mysql.user where user='root'; # 查询 root 用户授权情况
+------+-----------+
| user | host |
+------+-----------+
| root | % |
| root | localhost |
+------+-----------+
2 rows in set (0.00 sec)mysql> exit # 退出 MySQL 数据库
Bye
[root@master ~]# vi /etc/profile # 在文件末尾追加以下配置内容
# set hive environment
export HIVE_HOME=/usr/local/src/hive
export PATH=$PATH:$HIVE_HOME/bin
[root@master ~]# source /etc/profile # 使环境变量配置生效
[root@master ~]# su - hadoop
[hadoop@master ~]$ cp /usr/local/src/hive/conf/hive-default.xml.template /usr/local/src/hive/conf/hive-site.xml
[hadoop@master ~]$ vi /usr/local/src/hive/conf/hive-site.xml
[hadoop@master ~]$ mkdir /usr/local/src/hive/tmp
Hive 组件安装和配置完成。
[hadoop@master ~]$ cp /opt/software/mysql-connector-java-5.1.47.jar /usr/local/src/hive/lib/
[hadoop@master ~]$ stop-all.sh
[hadoop@master ~]$ start-all.sh
[hadoop@master ~]$ schematool -initSchema -dbType mysql
[hadoop@master ~]$ hive
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。