To use external database for Hive or Oozie metastore, ensure that a MySQL or Oracle database is deployed and available. (By default, Oozie uses Derby database for its metastore.)
Create database users for Hive Metastore and/or Oozie Metastore using one of the following options:
Option I: Allow HDP to create database users
Ensure that you have root privileges to the database instance.
Ensure that you deploy either a MySQL or an Oracle client on the master install machine.
On the master install machine, edit the
file and provide values for the following properties:master-install-machine
/gsInstaller/gsInstaller.propertiesTable 1.1. Properties to create database users Property Name Notes dbsysuser Database system user credentials for Oracle instance. Required if value of dbflavor
property is set tooracle
.dbsyspasswd hive_dbuser Database user credentials for Hive Metastore. Required if installing Hive. hive_dbpasswd oozie_dbname Database name for Oozie Metastore. Required if installing Oozie and if oozie_use_external_db
property is set toyes
. See Reference - Configuration Properties (oozie_use_external_db).oozie_dbuser Database user credentials for Oozie Metastore. Required if installing Oozie and if oozie_use_external_db
property is set toyes
.oozie_dbpasswd On the master install machine, execute the
setupDatabaseUsers
auxiliary script file.sh master-install-machine/gsInstaller/setupDataseUsers.sh
Option II: Manually create database users
Ensure that your database administrator creates the following databases and users:
For Hive:
hive_dbname
hive_dbuser
hive_dbpasswd
For Oozie:
oozie_dbname
oozie_dbuser
oozie_dbpasswd
On the master install machine, edit the
file and provide values for the Hive and/or Oozie users (as listed in the table above).master-install-machine
/gsInstaller/gsInstaller.properties
Instructions to setup MySQL database
You can deploy a MySQL instance using one of the following options:
Option I: Allow HDP to deploy MySQL instance
On the master install machine, edit the
file and provide values for the following properties:master-install-machine
/gsInstaller/gsInstaller.propertiesdbflavor=mysql
dbhost=$FQDN_of_MySQL_host_machine
On the master install machine, deploy a MySQL client.
Execute the auxiliary script
startMySql.sh
:sh master-install-machine/gsInstaller/startMySql.sh
Option II: Manually deploy MySQL
Connect to the host machine where you plan to deploy MySQL instance and from a terminal window, type:
For RHEL and CentOS:
yum install mysql-server
For SLES:
zypper install mysql
Start the instance.
For RHEL and CentOS:
/etc/init.d/mysqld start
For SLES:
/etc/init.d/mysqld start
Set the
root
user password and remove unnecessary information fromlog
andSTDOUT
mysqladmin -u root password $password
mysqladmin -u root 2>&1 >/dev/null
Instructions to configure Oracle database
To configure Oracle database instance, use the following instructions:
Note | |
---|---|
The following instructions are for OJDBC driver for Oracle 11g. |
On the master install machine, edit the
file and provide values for the following properties:master-install-machine
/gsInstaller/gsInstaller.propertiesdbflavor=oracle
dbhost=$FQDN_of_Oracle_host_machine
Download the Oracle JDBC driver from here.
If you are manually creating the database users, ensure that your database administrator deploys the Hive schema. The Hive schema file is located here:
master-install-location/gsInstaller/confSupport/sql/oracle/hive-schema-0.10.0.oracle.sql