Use MySQL for the Hive Metastore
The metadata for Hive tables and partitions are stored in the Hive Metastore. By default, the Hive Metastore stores all Hive metadata in an embedded Apache Derby database in the HPE Data Fabric file system. Derby only allows one connection at a time; if you want multiple concurrent Hive sessions, you can use MySQL for the Hive Metastore.
Prerequisites
- Verify that MySQL (version 5.6.17 or later) is installed on the machine that will
host the Hive metastore, and also verify that you can connect to the MySQL server
from the Hive machine. You can run the Hive metastore on any machine that is
accessible from Hive. You can test this with the following
command:
mysql -h <hostname> -u <user> - The database administrator must create a database for the Hive metastore data, and
the username specified in
javax.jdo.option.ConnectionUserNamemust have permissions to access it. The database can be specified using theConnectionURLparameter. The tables and schemas are created automatically when the metastore is first started.
TIP
In MapR 6.1.0 and earlier releases, the following steps can be used
interchangeably for MariaDB.About this task
IMPORTANT
For MySQL 8, set the
javax.jdo.option.ConnectionDriverName property to
com.mysql.cj.jdbc.Driver. The com.mysql.jdbc.Driver
is deprecated. The new driver class is com.mysql.cj.jdbc.Driver.
However, the driver is automatically registered via the Service Provider Interface, so
manual loading of the driver class is generally unnecessary.