I used the hostname in the route and nodeport assigned to 5000 but it still giving connection timeout error when i am doing telnet
Original Message:
Sent: Mon November 20, 2023 08:53 AM
From: Arif Ali
Subject: Accessing Db2 database inside OpenShift cluster
When externally connecting to a database running in OCP, you must use NodePort (which are randomly assigned port numbers mapped to the database port numbers). As mentioned above, if you have used MAS devops scripts to deploy Manage, you will see a Route in db2 project. Use that route URL (without https) as a host. Use the randomly assigned NodePort number to port 50000 (locate that number, starts with 32, in the Services section under Networking). It will connect successfully.
------------------------------
Arif Ali
Original Message:
Sent: Sun November 19, 2023 11:30 PM
From: Muhammad haris bin javaid
Subject: Accessing Db2 database inside OpenShift cluster
Hi,
I am trying to access it using route host name and port 50000, 50001 but its giving me connection timeout error only port that works is 443 but it needs certificate.
I want to access it without using certificate outside openshift
Reagrds
Muhammad haris bin javaid
------------------------------
Muhammad haris bin javaid
Original Message:
Sent: Mon July 10, 2023 08:30 AM
From: Francois Beliveau
Subject: Accessing Db2 database inside OpenShift cluster
Thanks that worked like a charm
------------------------------
Francois Beliveau
Original Message:
Sent: Mon July 10, 2023 08:22 AM
From: Arif Ali
Subject: Accessing Db2 database inside OpenShift cluster
Port-forwarding works, but it is just extra steps and not very convenient. There is a Route available in the db2 project. Use that as a host. DB2's port 50000 and 50001 are mapped to randomly generated port numbers of OCP (you'll see those if you trace them in the Service section from the Route). Additionally, you can also use db2 pod's command line via Terminal (su - db2inst1) to query the database from the terminal. Certificate is only needed for SSL connection.
------------------------------
Arif Ali
Original Message:
Sent: Sat July 08, 2023 05:20 PM
From: Francois Beliveau
Subject: Accessing Db2 database inside OpenShift cluster
I've managed to do it. Not sure it's the easiest way but it involves using oc command line port forwarding to make it that, for example, localhost:12345 points to the db2 pod, port 50001
You also need to get the certificate, add it to your SQL Developer truststore, and set up your connection profile to use localhost, whatever port you used for the port forwarding, and you are ready to go
Downside is you need to start port forwarding each and every time but that's not so bad
------------------------------
Francois Beliveau
Original Message:
Sent: Fri July 07, 2023 12:51 PM
From: Francois Beliveau
Subject: Accessing Db2 database inside OpenShift cluster
I've finally managed to finish my MAS Manage installation on a Single-Node OpenShift cluster. Done so using the ansible masdevops collection and once you know what you are doing (and the settings that need tweaking) it works like a charm.
Now that I've done so, I still have many interrogations.
One of them is : how can I query the database? It being inside the OpenShift cluster
I see there are many "Services" for the DB instance in OpenShift, and one actual "Route"
https://db2w-shared-db2u.apps.cluster.domain.com
I tried using that URL and port 50001 with proper username and password from SQL Developer but without much luck
Am I on the right track or there is something I don't understand?
------------------------------
Francois Beliveau
------------------------------