Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate a random server name when starting the JVM #245

Open
kirankolluri226 opened this issue Jun 24, 2021 · 1 comment
Open

How to generate a random server name when starting the JVM #245

kirankolluri226 opened this issue Jun 24, 2021 · 1 comment

Comments

@kirankolluri226
Copy link

I am working on migrating an application from WAS ND to OpenShift (using docker images from WAS Base repo). This migration has been pretty straight forward for all applications i have worked on, but there is a specific application which runs fine when only one instance of WAS pod is running, but if i try to start a second pod the application will not start on the second pod. The reason being the application is reading the variable ${WAS_SERVER_NAME} from websphere variables and storing it in a DB table. For the application internal load balancing it looks like they have disabled startup of the jvm's with same name. Since i am using WAS traditional image and all was jvm's are named "server1" I am currently limited to start only one instance of this specific application. I am looking to see if i can generate a random uuid for the JVM name instead of "server1", so that when i start like 5 pods of this application each of them have a random name and i do not run into this issue in future.
I have tried using /work/update_config.sh & /work/update_config.py trying to generate random uuid's and passing it to the python script, trying to see if i can fix this by just updating the websphere variable and having to update the actual jvm name.
I am trying to see if i can implement this by updating the create_profile.sh as well.
Any suggestions or inputs here are helpful, thanks in advance.

@srbala
Copy link

srbala commented Feb 23, 2022

@kirankolluri226 Two options

  1. Check the server start script, new pod needs to set prefered name in SERVER_NAME=${SERVER_NAME:-"server1"} https://github.com/WASdev/ci.docker.websphere-traditional/blob/master/docker-build/8.5.5.20/scripts/start_server.sh
  2. make your application read diffrent variable, like hostname+servername that would make uniquename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants