Legacy platform

JVM identifier

You may have to run many JVMs in a large Sterling™ Order Management System Software configuration. It is useful to tag JVMs with an identifier so that they are easy to identify, monitor, and manage.

One approach to tagging is to use the JVM -D option. The -D option lets you set a system property variable as a name/value pair. For example:


   java -Dyfsag=SCHEDULE ..... <class name>     and
   java -Dyfsas=server01 ..... <class name>
   

In the example above, we use the -D option to set a name/value pair to help identify the purpose of the JVM. The names, yfsag and yfsas, indicate the type of workload - in this case, a Sterling Order Management System Software agent and an application server respectively. The values, SCHEDULE and server01, indicate the instance of the workload. If you issue the following command:


   ps -ef | grep java | grep Dyfs
   

you will see:


      UID   PID  PPID  C    STIME  TTY     TIME CMD
   user03  6420  6418  2 08:20:21 pts/29   0:04 java -Dyfsag=SCHEDULE -server 
   user03  6456  6443  2 08:23:32 pts/29   0:23 java -Dyfsas=server01 -server 
   

The tagging and some simple scripting allows you to automate a lot of management tasks. For example, to generate a thread dump on all the application servers, you could issue the following command:


   for i in ‘ps -ef | grep Dyfsas | awk '{print $2}'‘
   do
   kill -3 $i
   echo "Issued thread dump for pid=$i"
   done
   
   or 
   
   ps -ef | grep Dyfsas | awk '{print $2}' | xargs kill -3