You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Dick Davies <ra...@gmail.com> on 2008/07/26 15:07:09 UTC

clustering Roller4 : how do you make sure tasks.clientId is unique?

Hi, we're running a 2 node GFv2 cluster, and we've got the Roller
weblogger running on both nodes.

How do people generally get around this:

  # client identifier. should be unique for each instance in a cluster.
   tasks.clientId=defaultClientId

(in roller.properties)?

Since both glassfish instances are running the same WAR file, they
both have the same clientid.

I really don't want to have to write N different WARfiles, so I'm
wondering if there's some way to pick up a system property or something?


-- 
Rasputnik :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/

Re: clustering Roller4 : how do you make sure tasks.clientId is unique?

Posted by Dick Davies <ra...@gmail.com>.
On Sat, Jul 26, 2008 at 5:01 PM, Anil Gangolli <an...@busybuddha.org> wrote:

> In your roller-custom.properties, define:
>
> tasks.clientId=${my.clientId.property}
> config.expandedProperties=uploads.dir,search.index.dir,tasks.clientId
>
> Your property (my.clientId.property) must be defined as a Java system
> property in the JVM by the time that the Roller webapp context initializes.

That's great, I can get it that far by telling the glassfish node agents
to start the server instances with the appropriate options to the JVMs.

> Maybe we should add tasks.clientId to the default list of expanded
> properties in the distribution.  I'm not sure how other people are doing
> this right now and if there's a better overall approach to determining the
> client id.

My gut reaction says to make it default to something like the hostname,
but it doesn't seem like Java exposes that as a system property (could
be wrong, I haven't done Java development for a few years)?
In that case you're going to have to set a custom property at JVM startup
anyway.

Thanks a lot!



-- 
Rasputnik :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/

Re: clustering Roller4 : how do you make sure tasks.clientId is unique?

Posted by Anil Gangolli <an...@busybuddha.org>.
There is a way to get System property expansion in Roller properties.

System property references of the form ${propname} are expanded when 
they appear in some (not all) Roller properties.

There is a property called config.expandedProperties that determines the 
list of properties that get the expansion treatment.  By default this 
property is set as follows (you can find this in roller.properties):

config.expandedProperties=uploads.dir,search.index.dir

You should be able to redefine this property as well as the clientId in 
roller-custom.properties to achieve what you want.

In your roller-custom.properties, define:

tasks.clientId=${my.clientId.property}
config.expandedProperties=uploads.dir,search.index.dir,tasks.clientId

Your property (my.clientId.property) must be defined as a Java system 
property in the JVM by the time that the Roller webapp context initializes.

Not sure if this is enough for you.  If you have a startup script that 
starts the JVM with -Dmy.clientId.property=`hostname` (assuming a *nix 
shell), this may be unique enough if you aren't running multiple 
instances on any one host.

Maybe we should add tasks.clientId to the default list of expanded 
properties in the distribution.  I'm not sure how other people are doing 
this right now and if there's a better overall approach to determining 
the client id.

--a.

Dick Davies wrote:
> Hi, we're running a 2 node GFv2 cluster, and we've got the Roller
> weblogger running on both nodes.
>
> How do people generally get around this:
>
> # client identifier. should be unique for each instance in a cluster.
> tasks.clientId=defaultClientId
>
> (in roller.properties)?
>
> Since both glassfish instances are running the same WAR file, they
> both have the same clientid.
>
> I really don't want to have to write N different WARfiles, so I'm
> wondering if there's some way to pick up a system property or something?
>
>