Chapter 1. 3scale system image with Oracle Database
By default, Red Hat 3scale API Management 2.5 has a component called system
that stores configuration data in a MySQL database. You have the option to override the default database and store your information in an external Oracle Database. Follow the steps in this document to build a custom system container image with your own Oracle Database client binaries and deploy 3scale to OpenShift.
1.1. Before you begin
1.1.1. Obtaining Oracle software components
Before you can build the custom 3scale system container image, you must acquire a supported version of the following Oracle software components:
- Oracle Instant Client Package Basic or Basic Light
- Oracle Instant Client Package SDK
- Oracle Instant Client Package ODBC
1.1.2. Prerequisites
- Supported version of Oracle Database accessible from your OpenShift cluster
- Access to the Oracle Database system user for installation procedures
-
The 3scale 2.5
amp.yml
template
1.2. Preparing Oracle Database
Create a new database.
The following settings are required for the Oracle Database to work with 3scale:
ALTER SYSTEM SET max_string_size=extended SCOPE=SPFILE; ALTER SYSTEM SET compatible='12.2.0.1' SCOPE=SPFILE;
Collect the database details.
Get the following information that will be needed for 3scale configuration:
- Oracle Database URL
- Oracle Database service name
- Oracle Database system user name and password
- Oracle Database service name
For information on creating a new database in Oracle Database, see the Oracle documentation.
1.3. Building the system image
- Clone the 3scale-amp-openshift-templates GitHub repository.
-
Place your Oracle Database Instant Client Package files into the
3scale-amp-openshift-templates/amp/system-oracle/oracle-client-files
directory. Run the
oc new-app
command with the-f
option and specify thebuild.yml
OpenShift template:$ oc new-app -f build.yml
Run the
oc new-app
command with the-f
option, specifying theamp.yml
OpenShift template, and the-p
option, specifying theWILDCARD_DOMAIN
parameter with the domain of your OpenShift cluster:$ oc new-app -f amp.yml -p WILDCARD_DOMAIN=example.com
Enter the following shell
for
loop command, specifying the following information you collected in the Preparing Oracle Database section previously:-
{USER}
: the username that will represent 3scale in your Oracle Database -
{PASSWORD}
: the password forUSER
-
{ORACLE_DB_URL}
: the URL of your Oracle Database -
{DATABASE}
: the service name of the database you created in Oracle Database -
{PORT}
: the port number of your Oracle Database
for dc in system-app system-sidekiq system-sphinx; do oc env dc/$dc --overwrite DATABASE_URL="oracle-enhanced://{USER}:{PASSWORD}@{ORACLE_DB_URL}:{PORT}/{DATABASE}"; done
-
Enter the following
oc patch
command, specifying the sameUSER
,PASSWORD
,ORACLE_DB_URL
,PORT
, andDATABASE
values that you provided in the previous step:$ oc patch dc/system-app -p '[{"op": "replace", "path": "/spec/strategy/rollingParams/pre/execNewPod/env/1/value", "value": "oracle-enhanced://{USER}:{PASSWORD}@{ORACLE_DB_URL}:{PORT}/{DATABASE}"}]' --type=json
Enter the following
oc patch
command, specifying your own Oracle Database system user password in theSYSTEM_PASSWORD
field:$ oc patch dc/system-app -p '[{"op": "add", "path": "/spec/strategy/rollingParams/pre/execNewPod/env/-", "value": {"name": "ORACLE_SYSTEM_PASSWORD", "value": "SYSTEM_PASSWORD"}}]' --type=json
Enter the
oc start-build
command to build the new system image:oc start-build 3scale-amp-system-oracle --from-dir=.