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
Perform the following steps on the Ambari Server host.
- Download JDBC Driver.
- Navigate to the Oracle JDBC Driver Download Page to download the JDBC Driver.
- Download the JDBC driver compatible with Oracle Database 19c:
- Select Oracle Database 23ai (23.8.0.25.04) JDBC Driver.
- Download ojdbc11.jar
- 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.
- Connect to SYSBDA.
sqlplus / as sysdba
- 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@kafka-upg acceldata]# ambari-server setup
Using python /usr/bin/python3.11
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)?
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)?
Check JDK version for Ambari Server...
JDK version found: 8
Minimum JDK version is 11 for Ambari. Setup JDK again only for Ambari Server.
Do you want to change Oracle JDK for Ambari Server [y/n] (n)? y
[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-1.8.0-openjdk
Validating JDK on Ambari Server...done.
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)?
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 (3): 3
Hostname (kafka-upg.acceldata.ce):
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata):
Configuring ambari database...
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-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)?
Extracting system views...
.Error extracting ambari-views-package-2.7.8.5-2.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
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;
Verify all the tables.
For new installations, run the following 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.
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
- Run the following script.
[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.
- Verify Ambari logs (ambari-server.{log,out}) for errors and ensure users can access the Ambari Web UI.
- Register hosts and provide repo details to set up the cluster.
