root
root

Reputation: 1583

Linking Tomcat to MYSQL on Openshift

I've a java web application running on openshift 3 online. I'm rather new to this platform and not familiar to the usage of service and pods.

So currently i have 2 containers running. A. Web app B. MYSQL

I've created environment variables to supply the MYSQL username,password,port and ip-address to the container A running the web application. However, it seem like when openshift creates a new pod, the ip-address changes. Is there any other way i could link the two container so that i don't have to rely on the ip-address?

Upvotes: 0

Views: 389

Answers (1)

alirabiee
alirabiee

Reputation: 1306

Each service has a name/domain name. You should use their name to specify their location, rather than the IP address. Internally, the name will be resolved to the IP address.

You can find the name in the service details in the web console.

enter image description here

Upvotes: 2

Related Questions