Configure DB2 REST component on Openshift
Enabling and initializing DB2 provided REST component
Author(s): Tamas Bures | Created: 16 July 2020 | Last modified: 16 July 2020
Tested on: Red Hat OpenShift Platform v 4.3.24 & IBM DB2 11.5.4
Table of contents
Configure DB2 REST component on Openshift↑
In this guide, I will demonstrate how to enable DB2 REST component and create the initial configuration.
Prerequisites↑
-
An installed DB2 on Openshift with
rest.enabled="true"
inhelm_options
file. See this guide for more details. -
An already created database (
TEST
in my environment).
Configuration↑
-
Open a shell to the POD where the REST component is created either by using OCP console or command line. The POD name usually in this form:
<RELEASE_NAME>-db2u-rest-<random numbers and letters>
. -
Stop the REST component with the following command:
/opt/ibm/dbrest/scripts/db2rest-stop.sh
Example output:
Stopping the Db2 REST server... SERVER STATUS: INACTIVE
-
Create the initial config with the following command:
/opt/ibm/dbrest/scripts/db2rest-setup.sh <HOSTNAME> <DB> \ <DB_PORT> <SSL> <SCHEMA NAME> <DB2 USER> <DB2 USER PASSWORD>
Where:
HOSTNAME
is the publicly availabl hostname where DB2 listens (in my case, it is an exposed NodePort through load balaner)DB
the created database (TEST
in my case)PORT
where DB2 listens (default is50000
)SSL
Y/NSCHEMA NAME
where the tool creates the required tablesDB2 USER
the user who can connect to the database (default isdb2inst1
)DB2 USER PASSWORD
password of the user
Example command:
/opt/ibm/dbrest/scripts/db2rest-setup.sh db2u-rest.ocp.sechu.ibm TEST 50000 N DB2REST db2inst1 password
Example output:
Creating REST Services metadata... REST Services metadata created in schema DB2REST.
-
Start the REST component with the following command:
/opt/ibm/dbrest/scripts/db2rest-start.sh
Example output:
Starting the Db2 REST server... SERVER STATUS: ACTIVE