CentOS7默认使用的MySQL分支 MariaDB
#yum -y install mariadb*
#mysqladmin -uroot password hadoop
#systemctl start mariadb
#systemctl enable mariadb //开机自启
#mysql -uroot -phadoop
mysql> grant all on *.* to 'root'@'%' identified by 'hadoop';
mysql>flush privileges;
mysql>exit8、安装MySQL连接工具
这里使用的rpm方式安装
Master端:
#wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.11-1.el7.noarch.rpm
//从MySQL官网下载
//mysql-connector-java 依赖java-headless
#yum -y install java-headless
#rpm -ivh mysql-connector-java-8.0.111-.el7.noarch.rpm复制链接库文件#rpm -ql mysql-connector-java
将jar包拷贝到hive的lib下
#cp /usr/share/java/mysql-connector-java-8.0.11.jar /hadoop/hive/lib/
9、拷贝安装包
将Master端配置好的hive拷贝到2个slave节点
scp -r /usr/local/src/apache-hive-1.2.2-bin root@slave1:/usr/local/src/apache-hive-1.2.2-bin
scp -r /usr/local/src/apache-hive-1.2.2-bin root@slave2:/usr/local/src/apache-hive-1.2.2-bin
10、启动hive#/hadoop/hive/bin/hive
11、测试hive> create database test_for_hive;
OK
Time taken: 1.243 seconds
hive> show databases;
OK
default
hice_test
hive_test2
test_for_hive
Time taken: 1.3 seconds, Fetched: 4 row(s)