To use a MariaDB database, follow these steps to install and setup MariaDB.
- Installing the Mysql database server
sudo yum install mariadb-server
- Ensure the MySQL server starts at boot.
sudo systemctl enable mariadb.service
- Start the Maria DB server
sudo systemctl start mariadb
- Setting up root password
The following the steps to configure mysql root password:
- Enter current password for root (enter for none): OK, successfully used password, moving on…
- Set root password? [Y/n] y New password: Re-enter new password:
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] n
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y
Once you configure the mariadb, you can login using root and password the has been setup to create the necessary databases for the cloudera manager.
- Creating required Databases for cloudera manager and other services
mysql -u root -p
MariaDB [(none)]> create database scm;
Create databases for other services as follows
create database hive; create database oozie; create database hue; create database reportmanager;
Creating users for all the services
CREATE USER 'hive'@'%' IDENTIFIED BY 'itversity'; CREATE USER 'oozie'@'%' IDENTIFIED BY 'itversity'; CREATE USER 'hue'@'%' IDENTIFIED BY 'itversity'; CREATE USER 'rm'@'%' IDENTIFIED BY 'itversity'; CREATE USER 'scm'@'%' IDENTIFIED BY 'itversity';
Give permission to the created users to perform necessary operations on the database.
GRANT ALL PRIVILEGES ON scm.* TO 'scm'@'%'; GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%'; GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%'; GRANT ALL PRIVILEGES ON hue.* TO 'hue'@'%'; GRANT ALL PRIVILEGES ON reportmanager.* TO 'rm'@'%';
To tell the server to reload the grant tables, perform a flush-privileges operation. This can be done by using the following command.
Installing the MariaDB JDBC Driver
We need to install JDBC driver on the hosts where Cloudera manager and its services are running along with a host running Hive Meta store. We can install all services in a single host or you can install them in different hosts.
Note: Cloudera recommends that you assign all roles that require databases on the same host and install the driver on that host.
sudo yum -y install mysql-connector-java