On the Ambari Server machine, install the appropriate .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
For MySQL:
Install the MySQL connector.
yum install mysql-connector-java*
Make sure the .jar file has the appropriate permissions.
For Oracle:
The .jar file should have 644 permissions.
For MySQL:
cd /usr/share/java ls mysql*
Should return present and 644 permissions.
Create the Ambari user, password, and tablespace, and grant the account database permissions.
For Oracle:
# sqlplus sys/root as sysdba SQL> create user $AMBARIUSER identified by $AMBARIPASSWORD default tablespace "USERS" temporary tablespace "TEMP"; SQL> grant unlimited tablespace to $AMBARIUSER; SQL> grant create session to$AMBARIUSER; SQL> grant create table to $AMBARIUSER; SQL> quit;
Where
$AMBARIUSER
is the Ambari user name and$AMBARIPASSWORD
is the Ambari user password.For MySQL, on the MySQL server host:
mysql -u root CREATE USER '$AMBARIUSER'@'%' IDENTIFIED BY '$AMBARIPASSWORD'; GRANT ALL PRIVILEGES ON *.* TO '$AMBARIUSER'@'%'; CREATE USER '$AMBARIUSER'@'localhost' IDENTIFIED BY '$AMBARIPASSWORD'; GRANT ALL PRIVILEGES ON *.* TO '$AMBARIUSER'@'localhost'; CREATE USER'$AMBARIUSER'@'$AMBARISERVERFQDN' IDENTIFIED BY '$AMBARIPASSWORD'; GRANT ALL PRIVILEGES ON *.* TO '$AMBARIUSER'@'$AMBARISERVERFQDN'; FLUSH PRIVILEGES;
Where $AMBARISERVERFQDN is the Fully Qualified Domain Name of the Ambari server host.
Load the database schema on the Ambari Server host.
For Oracle:
Create the Ambari Server schema by running a script.
sqlplus $AMBARIUSER/$AMBARIPASSWORD < /var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql
The file
Ambari-DDL-Oracle-CREATE.sql
is found in the/var/lib/ambari-server/resources/
directory of the Ambari Server machine, once you have completed the Set Up the Bits step in the install process.For MySQL:
Create the Ambari Server database and schema.
mysql -u $AMBARIUSER -p
CREATE DATABASE $AMBARIDATABASE; USE $AMBARIDATABASE; SOURCE Ambari-DDL-MySQL-CREATE.sql;
Where $AMBARIDATABASE is the Ambari database name.
When setting up the Ambari server, select Advanced Database Configuration > option 3: MySQL.
On the Ambari server host, find the database schema in /var/lib/ambari-server/resources/ after setting up the bits during the installation process.