Hive: Enable mysql metastore

Install Mysql database

Create new user and grant permissions

Keep the mysqld service running on boot

$ systemctl enable mysqld

Crceate user account for hive in mysql. Login to mysql with root permission.

$ mysql -u root -p

<enter root passwowrd at the prompt>

CREATE USER 'hive'@'localhost' IDENTIFIED BY 'Mapr@123';

CREATE USER 'hive'@'%' IDENTIFIED BY 'Mapr@123';

GRANT ALL PRIVILEGES ON * . * TO 'hive'@'localhost';

GRANT ALL PRIVILEGES ON * . * TO 'hive'@'%';

Update hive-site.xml file with the following property. In MapR sandbox (v6), the file can be found in /opt/mapr/hive/hive-2.1/conf/hive-site.xml





<description>JDBC connect string for a JDBC metastore</description>





<description>Driver class name for a JDBC metastore</description>





<description>username to use against metastore database</description>





<description>password to use against metastore database</description>



Restart the Hive Meta Store Service and Hive2 services.

Side note:

Extend the root LVM size on the VM.

Shutdown the VM, go to Settings > Storage > Controller

Click on the icon for "Add Hard Disk".

Select the size 51GB.

Start the VM and the run the following commands using root login.

fdisk -l | grep /dev

pvcreate /dev/sdb

vgextend vg_maprdemo /dev/sdb

vgdisplay vg_maprdemo | grep "Free"

lvextend -L+50G /dev/vg_maprdemo/lv_root

resize2fs /dev/vg_maprdemo/lv_root

df -h