On the Hive Metastore machine, install the appropriate JDBC .jar file.
For Oracle:
Download the Oracle JDBC (OJDBC) driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
Select
Oracle Database 11g Release 2 - ojdbc6.jar
.Copy the .jar file to the Java share directory.
cp ojdbc6.jar /usr/share/java
Make sure the .jar file has the appropriate permissions - 644.
For MySQL:
Install the connector.
RHEL/CentOS/Oracle Linux
yum install mysql-connector-java
SLES
zypper install mysql-connector-java
Confirm that
MySQL.jar
file is in the Java share directoryls /usr/share/java/mysql-connector-java.jar
Make sure the .jar file has the appropriate permissions - 644.
On the Ambari Server host, install the appropriate JDBC .jar file.
For Oracle:
Download the Oracle JDBC (OJDBC) driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
Select
Oracle Database 11g Release 2 - ojdbc6.jar
.Copy the .jar file to the Java share directory.
cp ojdbc6.jar /var/lib/ambari-server/resources
Make sure the .jar file has the appropriate permissions - 644.
For MySQL:
Download the mysql connector driver from the host on which you installed mysql-connector-java.
Copy the .jar file to the Java share directory.
cp mysql-connector-java.jar /var/lib/ambari-server/resources
Make sure the .jar file has the appropriate permissions - 644.
Create a user for Hive and grant it permissions.
For Oracle, create the Hive user and grant it database permissions.
# sqlplus sys/root as sysdba SQL> CREATE USER $HIVEUSER IDENTIFIED BY $HIVEPASSWORD; SQL> GRANT SELECT_CATALOG_ROLE TO $HIVEUSER; SQL> GRANT CONNECT, RESOURCE TO $HIVEUSER; SQL> QUIT;
Where
$HIVEUSER
is the Hive user name and$HIVEPASSWORD
is the Hive user password.For MySQL, create the Hive user and grant it database permissions.
# mysql -u root -p mysql> CREATE USER ‘$HIVEUSER’@’%’ IDENTIFIED BY ‘$HIVEPASSWORD’; mysql> GRANT ALL PRIVILEGES ON *.* TO ‘$HIVEUSER’@’%’; mysql> flush privileges;
Where
$HIVEUSER
is the Hive user name and$HIVEPASSWORD
is the Hive user password.
Load the Hive Metastore schema into your Hive database using a schema script.
For Oracle, for HDP 2.1:
Download the script required to create the database schema from: http://public-repo-1.hortonworks.com/ambari/scripts/upgrade/1.5.1/oracle/hive-schema-0.13.0.oracle.sql .
Create the schema by executing the following instruction:
sqlplus $HIVEUSER/$HIVEPASSWORD < hive-schema-0.13.0.oracle.sql
For Oracle, for HDP 2.0:
Find
hive-schema-0.12.0.oracle.sql
in the/var/lib/ambari-server/resources/
directory of the Ambari Server machine, after installing the Ambari Server.Create the schema by running the following instruction:
sqlplus $HIVEUSER/$HIVEPASSWORD < hive-schema-0.12.0.oracle.sql
For MySQL, for HDP 2.1:
Download the script required to create the database schema from: http://public-repo-1.hortonworks.com/ambari/scripts/upgrade/1.5.1/mysql/hive-schema-0.13.0.mysql.sql .
Create the schema by executing the following instruction:
mysql $HIVEUSER/$HIVEPASSWORD < hive-schema-0.13.0.mysql.sql