赞
踩
[root@master ~]# tar -zxvf /opt/software/apache-hive-2.0.0-bin.tar.gz -C /usr/local/src
[root@master ~]# mv /usr/local/src/apache-hive-2.0.0-bin usr/local/src/hive
[root@master ~]# chown -R hadoop:hadoop /usr/local/src/hive
[root@master ~]# systemctl stop firewalld
root@master ~]# systemctl disable firewalld
1)查看 Linux 系统中 MariaDB 的安装情况
[root@ master ~]# rpm -qa | grep mariadb
2)卸载 MariaDB 软件包
[root@master ~]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
[root@master ~]# cd /opt/software/mysql-5.7.18/
[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
[root@master ~]# vi /etc/my.cnf
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
[root@master ~]# mysql -uroot -p
[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
1)设置MySQL数据库连接
2)配置MySQL数据库root密码
3)验证元数据存储版本一致性。若默认false,则不用修改
4)配置数据库驱动
5)配置数据库用户名
6)替换目录
7)在Hive安装目录中创建临时文件夹tmp
[hadoop@master ~]$ cp /opt/software/mysql-connector-java-5.1.47.jar /usr/local/src/hive/lib/
[hadoop@master lib]$ stop-all.sh
[hadoop@master lib]$ start-all.sh
[hadoop@master ~]$schematool -initSchema -dbType mysql
[hadoop@master ~]$ hive
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。