users@glassfish.java.net

Re: How to set per instance jvm options in glassfish?

From: kedar <Kedar.Mhaswade_at_Sun.COM>
Date: Thu, 25 Jan 2007 09:29:23 -0800

Hi Andrew,
(Sorry for referring you as Andrews, earlier :) )

Let me tell you the high-level idea (and I am going to
blog about it once I get a breather).

In the domain.xml, we can store a token almost anywhere, like
this:
<domain>
...
<configs>
<config name="aconfig">
  <java-config ...>
    <jvm-options> ${TokenForDashD} </jvm-options>
    ...
  </java-config>
</config>
</configs>

<servers>
<server name="server1" config-ref="aconfig">
   ...
  <system-property name="TokenForDashD" value="Foo"/>
</server>

<server name="server1" config-ref="aconfig">
   ...
  <system-property name="TokenForDashD" value="Bar"/>
</server>
</servers>
...
</domain>

Hope you are with me.

Now, when "server1" starts, it will take value of "TokenForDashD" to
be "Foo", whereas "server2" will take it as "Bar" passed to the Java
command invocation that starts the server instance!

Is that what you are not looking for?
Sorry if I misunderstood.

If this is what it is, I will document this as a blog and then
make sure our official documentation reflects this.

Thanks and Regards,
Kedar

PS: Like I said, there are a few bugs in this and we will fix them soon.

Replogle, Andrew wrote:
> Kedar,
>
> Thank you for the link to the documentation, although I'm not sure this
> is what I'm looking for. I need to set specific JVM_OPTS per instance.
>
> Ie.
> -Dframework.propertyregistry.override=file:///path/to/our-application/ov
> errides to the vm when it starts.
>
> I tried using:
>
> asadmin.bat create-system-properties --user admin --host localhost
> --port 4848 --target instance-one
> -Dframework.propertyregistry.override=file:///path/to/file
>
> And I get a syntax error (CLI131). I'm not clear on how glassfish would
> know this is a jvm arg to be passed vs an environmental variable vs a
> glassfish specific property.
>
> Does this make sense? I'll continue to read through the documentation to
> see what I can find and lookup the error-codes to see if I'm just
> passing the jvm arg wrong.
>
>
> Andrew
>
> -----Original Message-----
> From: Kedar.Mhaswade_at_Sun.COM [mailto:Kedar.Mhaswade_at_Sun.COM]
> Sent: Wednesday, January 24, 2007 5:05 PM
> To: users_at_glassfish.dev.java.net
> Subject: Re: How to set per instance jvm options in glassfish?
>
> Hmmm.
>
> You have asked a great question, Andrew.
> And I am embarrassed to see that you could not find
> a helpful document somewhere. We do have this capability
> which we have "branded" as advanced capability and is
> called "application server system properties". These
> are nothing but tokens that can be replaced with certain
> values at various levels -> domain, cluster, config, server.
>
> See:
> http://docs.sun.com/source/819-0082/hman1/create-system-properties.1.htm
> l
>
> (Google Search words -- site:docs.sun.com Application Server System
> Properties)
>
> At the moment there are some issues with it, but it mostly
> works. We are fixing these issues. Please try out this stuff
> and let us know if that satisfies you. You may have to employ
> some work-arounds (like restarting node agent) for a transient
> set of problems that we have.
>
> Regards,
> Kedar
>
> Replogle, Andrew wrote:
>
>> Hello, I searched through the user list and couldn't find anything in
>> relation to this question:
>>
>> Say I have 2 instances in a cluster and I need each of them to start
>> with some unique JVM args that specify overrides property files for
>> the app because one instance will run jobs and has a slightly
>> different config. How can I configure specific jvm args at the
>> instance level. Right now from what I can see, on version2 build 32,
>> the entire cluster shares a config. How can I get more granular in the
>>
>
>
>> configuration?
>>
>> Domain
>>
>> Cluster------- This is the lowest level I can see that I can configure
>>
>
>
>> JVM args.
>>
>> Node(s)
>>
>> Instance(s)
>>
>> / \
>>
>> App1 App2
>>
>> -Dfoo=file1 -Dfoo=file2
>>
>> Thanks in advance J
>>
>> Andrew
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>