1、安裝並使用MariaDB做爲Ambari、Hive、Hue的存儲數據庫。java
yum install mariadb-server mariadb
啓動、查看狀態,檢查mariadb是否成功安裝mysql
systemctl start mariadb
systemctl status mariadb
2、配置mariadbsql
1,首先中止MariaDb 服務的運行 數據庫
systemctl stop mariadb
2,編輯/etc/my.cnf 在[mysqld]段下,添加以下幾行行配置:安全
transaction-isolation = READ-COMMITTED max_connections = 550 innodb_flush_method = O_DIRECT
保存退出後,配置mariadb服務開機啓動,並從新啓動MariaDB服務器
systemctl enable mariadb
systemctl start mariadb
3,運行mariadb安全配置腳本/usr/bin/mysql_secure_installation ,root@localhost,密碼這裏設爲hadoopoop
/usr/bin/mysql_secure_installation
****受權用戶root使用密碼passwd從任意主機鏈接*到mysql服務器spa
mysql -uroot -p use mysql; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '****' WITH GRANT OPTION; flush privileges;
**** 安裝MySQL JDBC Driver 鏈接 MariaDBcode
**** 下載、解壓縮,複製mysql-connector-java-5.1.46-bin.jar到/usr/share/java/,並重命名:server
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz tar zxvf mysql-connector-java-5.1.46.tar.gz cd mysql-connector-java-5.1.46/ cp mysql-connector-java-5.1.46-bin.jar /usr/share/java/mysql-connector-java.jar