1.4. Database requirements

  • 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.)

    • For instructions on deploying and/or configuring MySQL database, see here.

    • For instructions on configuring an existing Oracle database instance, see here.

      [Note]Note

      To deploy an Oracle instance, consult your database administrator.

  • Create database users for Hive Metastore and/or Oozie Metastore using one of the following options:

    • Option I: Allow HDP to create database users

      1. Ensure that you have root privileges to the database instance.

      2. Ensure that you deploy either a MySQL or an Oracle client on the master install machine.

      3. On the master install machine, edit the master-install-machine/gsInstaller/gsInstaller.properties file and provide values for the following properties:

        Table 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 to oracle.
        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 to yes. 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 to yes.
        oozie_dbpasswd
      4. On the master install machine, execute the setupDatabaseUsers auxiliary script file.

        sh master-install-machine/gsInstaller/setupDataseUsers.sh

    • Option II: Manually create database users

      1. Ensure that your database administrator creates the following databases and users:

        • For Hive:

          1. hive_dbname

          2. hive_dbuser

          3. hive_dbpasswd

        • For Oozie:

          1. oozie_dbname

          2. oozie_dbuser

          3. oozie_dbpasswd

      2. On the master install machine, edit the master-install-machine/gsInstaller/gsInstaller.properties file and provide values for the Hive and/or Oozie users (as listed in the table above).

 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

    1. On the master install machine, edit the master-install-machine/gsInstaller/gsInstaller.properties file and provide values for the following properties:

      dbflavor=mysql 
      dbhost=$FQDN_of_MySQL_host_machine
    2. On the master install machine, deploy a MySQL client.

    3. Execute the auxiliary script startMySql.sh:

      sh master-install-machine/gsInstaller/startMySql.sh
  • Option II: Manually deploy MySQL

    1. 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
    2. Start the instance.

      • For RHEL and CentOS:

        /etc/init.d/mysqld start
      • For SLES:

        /etc/init.d/mysqld start 
    3. Set the root user password and remove unnecessary information from log and STDOUT

      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]Note

The following instructions are for OJDBC driver for Oracle 11g.

  • On the master install machine, edit the master-install-machine/gsInstaller/gsInstaller.properties file and provide values for the following properties:

    dbflavor=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


loading table of contents...