Skip navigation
Currently Being Moderated

CF8 Multiserver configuration - how to identify jvm config file for an instance?

Jun 25, 2012 12:10 PM

hello.

 

i've inhereted a web server running the multiserver configuraiton of cf8, on a win2003 (64 bit), and i am wondering how to identify the jvm config file used by each instance?  i've found a number of config files in the JRun4/bin/ folder, but unfortunately they are not in all cases named the same as the cf instance. 

 

thanks for your help.

 
Replies
  • Currently Being Moderated
    Jun 25, 2012 1:48 PM   in reply to djangolives

    One way is to start the JRUN console and look at the settings of each instance to get a clue. It does not show the name of the config file though.

     

    But perhaps a better way is to look at the WIndows service of each instance in the services control panel and look for the  command line of the service, it contains the config file name. We moved from Windows to Linux so I can not supply exact steps.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 3:51 PM   in reply to djangolives

    On windows someone would have done something like jrunsvc -install <server_name> <server_name> "<service_name>" -config jvm_<server_name>.config.

     

    Maybe the "jvm.config" has a comment inside it expaining which instance it belongs to?

     

    Something you could do is enable some JVM logging and specify a sepate log name to the JVM arguments, then when you stop start an instance you will be able to identify the "jvm.config" to instance by the log name generated EG:

     

    One JVM.CONFIG

    java.args=-server etc -XX:+UseParallelGC -Xloggc:which_instance1.log etc

    Another JVM.CONFIG

    java.args=-server etc -XX:+UseParallelGC -Xloggc:which_instance2.log etc

     

    HTH, Carl.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 4:18 PM   in reply to djangolives

    The JRUN Admin Server is normally pre-installed as a service, as part of the CF installation. It normally runs under port 8000 so you could access it at http://localhost:8000 on the server itself for instance.

     

    I has a settings tab for each instance, which shows the JVM settings. IF each one had some unique setting, like Carl Type 3 suggests, you'd possibily see it there.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 5:26 PM   in reply to djangolives

    If the JVM arguments are "plain jane" not different to each other JMC will still not make the distinction clear. EG:

     

    Capture.JPG

     

    Capture2.JPG

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 7:57 PM   in reply to djangolives

    The JRUN Admin is not the same as the CF Admin..

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 12:13 AM   in reply to djangolives

    What about use JMC to apply a sane change to instance JVM arguments setting then go check Jrun4\bin\ as to which JVM.CONFIG has been updated. I expect there should be need to restart your production instances.

    Hope helps, Carl.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 8:52 AM   in reply to djangolives

    @djangolives, the simple answer is that what you seek is tracked in the registry. The longer answer, including how to get that info from the command line, follows.

     

    Since you’re running CF on Windows, then if you’re running each instance as a service, then @joopk was on the right track. The way to indicate a different jvm.config for an instance is to modify the service definition to denote it. And as Carl later noted, you do that using the command line jrunsvc command and the –config argument.  Sadly, there is no jrunsvc argument that lists these definitions (that I know of).

     

    And you’re right that if you look at the Windows service definition, all you’ll see is it pointing to jrunsvc.exe itself, not indicating the jvm.config.

     

    Instead, the configuration is saved as part of the Service definition as tracked by Windows in the registry, and that’s where you need to look to find this info. If you’re comfortable using RegEdit, I’ll share what you need to find it. If you may prefer to use a command-line tool instead, I’ll show that also, which is helpful both to get for many instances quickly as well as to avoid risk of editing values by mistake in regedit.

     

    First, note that all services are defined in the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\. So let’s say your service name of interest was “Adobe Coldfusion 8 AS instance1”. You’d find that there’s a key there with that name. And under that key you will see it has various values, among which is one (if you did modify it to have its own jvm.config) called “Parameters”, which is where the JRunSVC command would place this –config argument and value if provided.

     

    So that’s one way to find what config is used for what service. But a second way is to use the REG command-line tool (should be available free within Windows on most versions that I’ve seen.) You’d want to use its “query” argument, and you then pass it the keyname (including the service/instance name, so it’s varied a bit from what I showed above). Note also that if the service name has spaces, then you need to enclose the whole keyname in quotes.

     

    reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Adobe Coldfusion 8 AS instance1"

     

    That will show all the keys and their values, but even niftier is that you can get it to list JUST the one value you’re interested in (in this case, the one called “parameters”) using the /v argument:

     

    reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Adobe Coldfusion 8 AS instance1" /v parameters

     

    Note also that the reg query command also lets you specify the machine name (before the keyname) if you wanted to use this to run against other servers in your network, and it has still other args that may be of interest. Run “reg query /?” from the command line to learn more.

     

    I do think this will be the most straight-forward way to get the info you seek, @djangolives. Let us know if that helps or if you need more info.

     

    /charlie

     

    PS As I was responding to this note, and referring to djangolives and joopk above, I wondered, “do people realize they can change the forums to show their real name rather than just their Adobe ID?” I do appreciate that some may like it that way, but if you maybe didn’t know you could and you’d like to show your name instead, see another forum entry I just created at http://forums.adobe.com/thread/1029289.

     

    PPS I am also going to blog all this above. I was torn as to whether to do it there and point to it here, or vice-versa. I decided it may be best for all concerned to just repeat the info in both places. I’ll update the blog entry if we get some new info to modify what I propose above.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 9:38 AM   in reply to Charlie Arehart

    One more little tip about the above. If you wanted to just list all the jvm.configs for all the instances, without naming each one, you can do that also, using the REG command's /s command, as in:

     

    reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services" /v parameters /s


    This would return a list of each service definition that had a Parameters value. Here's an example of how that could look:

     

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Macromedia JRun Admin Server

        Parameters    REG_SZ    -config C:\Jrun4\bin\jvm.config

     

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Macromedia JRun CFusion Server

        Parameters    REG_SZ    -config C:\\Jrun4\\bin\\jvm2.config

     

    That's a lot easier than listing each service one by one! :-)

     

    Of course, technically this variation of the command would return info on any services that may have a parameters value, beyond just CF services. I'll note taht you could limit this list still further, using any of a number of available arguments to the REG QUERY command. Again, use REG QUERY /? to get more details.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 10:24 AM   in reply to Charlie Arehart

    Here' the blog entry I referred to:

     

    How to identify what jvm.config a #ColdFusion instance uses (and vice-versa)

    http://www.carehart.org/blog/client/index.cfm/2012/6/26/identifying_wh at_instance_uses_a_given_jvm_config

     

    (Or a shortened link: http://bit.ly/MVmBUo)

     

    BTW, to the suggesiton above of using the JRun Admin (or Management Console, or JMC), I do not find that it lists what jvm.config is used for a given instance, if indeed that instance it configured to run as a Windows service (which is what I think what djangolives had been referring to). If anyone finds otherwise, please do report it here, and I'll add that to my blog entry. Thanks.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2012 12:05 PM   in reply to Charlie Arehart

    Indeed, the JRUN management console doe not show the name of the config file used. But it shows the JVM settings so if you added a unique JVM setting to each config file yu could find it that way. It is a roundabout way.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2012 12:08 PM   in reply to djangolives

    Good to hear. Thanks (and to jkaashoek for confirming things about the JMC.)

     

     

     

    /charlie

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points