Using Ambari with Oracle

This page outlines the step-by-step instructions to install Apache Ambari with Oracle 19c as the backend database.

Prerequisites

Before you setup:

  • Ensure you have access to the Oracle 19c database (CDB + PDB setup).

  • Install Oracle JDBC drivers (ojdbc11.jar).

  • Create required users and grant permissions for Ambari.

  • Confirm Ambari is installed and Java is configured on the cluster.

Oracle Driver Details

Oracle Database Version

Drivers

File

Oracle Database 19c

Oracle Database 19c drivers

ojdbc11.jar

Download and Install Oracle JDBC Driver

Download JDBC Driver.

  1. Navigate to the Oracle JDBC Driver Download Page to download the JDBC Driver.

    1. Download the JDBC driver compatible with Oracle Database 19c:

      1. Select Oracle Database 23ai (23.8.0.25.04) JDBC Driver.

      2. Download ojdbc11.jar

  2. Copy the driver to Java shared directory.

cp ojdbc11.jar /usr/share/java/ chmod 644 /usr/share/java/ojdbc11.jar

Create Ambari Database and User in Oracle

Perform the following steps on the Oracle host using sqlplus.

  1. Connect ot SYSDBA.

sqlplus / as sysdba
  1. Switch Switch to the Pluggable Database (PDB).

>show con_name CON_NAME ------------------------------ CDB$ROOT SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB1 READ WRITE NO >ALTER SESSION SET CONTAINER=ORCLPDB1; >CREATE USER ambari IDENTIFIED BY bigdata default tablespace "USERS" temporary tablespace "TEMP"; >GRANT unlimited tablespace to ambari; >GRANT create session to ambari; >GRANT create TABLE to ambari; >GRANT create SEQUENCE to ambari;

Configure JDBC Driver with Ambari

Run the following command on the Ambari Server host.

[root@odp ~]# ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... WARNING: Could not run /usr/sbin/sestatus: OK Customize user account for ambari-server daemon [y/n] (n)? y Enter user account for ambari-server daemon (root): Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Custom JDK ============================================================================== Enter choice (1): 2 WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts. WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts. Path to JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 Validating JDK on Ambari Server...done. Check JDK version for Ambari Server... JDK version found: 11 Minimum JDK version is 11 for Ambari. Skipping to setup different JDK for Ambari Server. Checking GPL software agreement... GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? n Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? y Configuring database... ============================================================================== Choose one of the following options: [1] - PostgreSQL (Embedded) [2] - Oracle [3] - MySQL / MariaDB [4] - PostgreSQL [5] - Microsoft SQL Server (Tech Preview) [6] - SQL Anywhere [7] - BDB ============================================================================== Enter choice (1): 2 Hostname (localhost): <IP_address> Port (1521): Database name (ambari): <ambari-db-name> Username (ambari): <db-ambari-user-name> Enter Database Password (password): <ambari-user-password> Configuring ambari database... Enter full path to custom jdbc driver: /usr/share/java/ojdbc11.jar Configuring remote database connection properties... WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql Proceed with configuring remote database connection properties [y/n] (y)? y Extracting system views... Error extracting ambari-views-package-2.7.6.0.0.jar ....ambari-admin-2.7.6.0.0.jar Ambari repo file doesn't contain latest json url, skipping repoinfos modification Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully.

Ambari Server Schema Load

Perform the following steps.

  1. Navigate to Oracle sqlplus and run the queries of /var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql.

SQL> conn ambari/bigdata@ORCLPDB1 Connected. SQL> SELECT table_name, owner FROM all_tables ORDER BY owner, table_name;
  1. Verify all the tables.

For new installations, run the script: /var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql.

This script should be executed within the SQL*Plus (sqlplus) shell.

SQL> @/var/lib/ambari-server/resources/Ambari-DDL-Oracle-CREATE.sql Table created. Table created. .. 1 row created. 1 row created. .. .. Index created. Index created.
  1. Run the following command on the Ambari Server host.

ambari-server setup --jdbc-db=oracle --jdbc-driver=/usr/share/java/ojdbc11.jar

Start Ambari server

  1. Start the Ambari Server.

[root@odpnew-1-test ~]# ambari-server start Using python /usr/bin/python Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Ambari database consistency check started... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start......................................... Server started listening on 8080 DB configs consistency check: no errors and warnings were found. Ambari Server 'start' completed successfully.
  1. Verify Ambari logs (ambari-server.{log,out}) for errors and ensure users can access the Ambari Web UI.

  2. Register hosts and provide repo details to set up the cluster.


  Last updated