You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ingo Düppe <ma...@dueppe.com> on 2007/06/27 12:07:53 UTC

Server Node Id

Hello,

i run an application within a tomcat cluster. Now I need a unique key 
for each server node for the application. My first solution was a 
property file within the war file. But this is not so handy on 
deployment cycles.

Is there a better way to place a unique identify for each cluster node 
or does a identifier already exist.
The id must only be unique within the cluster not globaly.

Regard
Ingo

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Server Node Id

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Yes, I think so through JNDI, have a look at this stuff... maybe it will 
help
http://localhost:8080/tomcat-docs/config/globalresources.html

----- Original Message ----- 
From: "Ingo Düppe" <ma...@dueppe.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, June 28, 2007 1:04 PM
Subject: Re: Server Node Id


> Hi,
> I cannot use the ip address because on one maschine are running two or 
> more tomcat instances. Is it not possible to define the name of the tomcat 
> node for instance in the server.xml like it is done for the cluster 
> configuration. If I could get the name of the current node it would be all 
> I need.
>
> -Regards Ingo
>
> Johnny Kewl schrieb:
>> Also, maybe this is a good idea, one other thing I found handy behind a 
>> JK cluster is leaving 2 connectors open.
>> So you got the cluster server doing its round robin, but each machine can 
>> find the other machine directly through say port 8080.
>> So again in the dB, you just have to put the address of all the machines 
>> in.
>> Then if one machine say gets a file upload, it sends that to all the 
>> other machines, but through the direct port to bypass the clustering.
>>
>> Maybe.... sorry couldnt help you more
>>
>>
>> ----- Original Message ----- From: "Ingo Düppe" 
>> <ma...@dueppe.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Wednesday, June 27, 2007 10:13 PM
>> Subject: Re: Server Node Id
>>
>>
>>> Well, the reason is, that I need to run some tasks that have to be 
>>> executed on each node once within the cluster. So each node must be able 
>>> to identify these tasks that still need to be executed on this node. So 
>>> in my solution the server node gets its id and checks which was the last 
>>> task it has executed.
>>>
>>> Therefore the id must not change after each startup.
>>> - Ingo
>>>
>>> Johnny Kewl schrieb:
>>>> Interesting question... I dont know if there is a property one can 
>>>> call.
>>>> I had a similar need behind a JK load balancing scheme, what I did was 
>>>> just generate a unique ID when each cluster webapp starts up, something 
>>>> like the MS GUID idea.
>>>> No pre-configuration required.
>>>>
>>>> I think it would be very interesting to know why you doing this, think 
>>>> the guys will then really be abe to give you some good idea's.
>>>>
>>>>
>>>> ----- Original Message ----- From: "Ingo Düppe" 
>>>> <ma...@dueppe.com>
>>>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>>>> Sent: Wednesday, June 27, 2007 12:07 PM
>>>> Subject: Server Node Id
>>>>
>>>>
>>>>> Hello,
>>>>>
>>>>> i run an application within a tomcat cluster. Now I need a unique key 
>>>>> for each server node for the application. My first solution was a 
>>>>> property file within the war file. But this is not so handy on 
>>>>> deployment cycles.
>>>>>
>>>>> Is there a better way to place a unique identify for each cluster node 
>>>>> or does a identifier already exist.
>>>>> The id must only be unique within the cluster not globaly.
>>>>>
>>>>> Regard
>>>>> Ingo
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Server Node Id

Posted by Ingo Düppe <ma...@dueppe.com>.
Hi,
I cannot use the ip address because on one maschine are running two or 
more tomcat instances. Is it not possible to define the name of the 
tomcat node for instance in the server.xml like it is done for the 
cluster configuration. If I could get the name of the current node it 
would be all I need.

-Regards Ingo

Johnny Kewl schrieb:
> Also, maybe this is a good idea, one other thing I found handy behind 
> a JK cluster is leaving 2 connectors open.
> So you got the cluster server doing its round robin, but each machine 
> can find the other machine directly through say port 8080.
> So again in the dB, you just have to put the address of all the 
> machines in.
> Then if one machine say gets a file upload, it sends that to all the 
> other machines, but through the direct port to bypass the clustering.
>
> Maybe.... sorry couldnt help you more
>
>
> ----- Original Message ----- From: "Ingo Düppe" 
> <ma...@dueppe.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Wednesday, June 27, 2007 10:13 PM
> Subject: Re: Server Node Id
>
>
>> Well, the reason is, that I need to run some tasks that have to be 
>> executed on each node once within the cluster. So each node must be 
>> able to identify these tasks that still need to be executed on this 
>> node. So in my solution the server node gets its id and checks which 
>> was the last task it has executed.
>>
>> Therefore the id must not change after each startup.
>> - Ingo
>>
>> Johnny Kewl schrieb:
>>> Interesting question... I dont know if there is a property one can 
>>> call.
>>> I had a similar need behind a JK load balancing scheme, what I did 
>>> was just generate a unique ID when each cluster webapp starts up, 
>>> something like the MS GUID idea.
>>> No pre-configuration required.
>>>
>>> I think it would be very interesting to know why you doing this, 
>>> think the guys will then really be abe to give you some good idea's.
>>>
>>>
>>> ----- Original Message ----- From: "Ingo Düppe" 
>>> <ma...@dueppe.com>
>>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>>> Sent: Wednesday, June 27, 2007 12:07 PM
>>> Subject: Server Node Id
>>>
>>>
>>>> Hello,
>>>>
>>>> i run an application within a tomcat cluster. Now I need a unique 
>>>> key for each server node for the application. My first solution was 
>>>> a property file within the war file. But this is not so handy on 
>>>> deployment cycles.
>>>>
>>>> Is there a better way to place a unique identify for each cluster 
>>>> node or does a identifier already exist.
>>>> The id must only be unique within the cluster not globaly.
>>>>
>>>> Regard
>>>> Ingo
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Server Node Id

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Also, maybe this is a good idea, one other thing I found handy behind a JK 
cluster is leaving 2 connectors open.
So you got the cluster server doing its round robin, but each machine can 
find the other machine directly through say port 8080.
So again in the dB, you just have to put the address of all the machines in.
Then if one machine say gets a file upload, it sends that to all the other 
machines, but through the direct port to bypass the clustering.

Maybe.... sorry couldnt help you more


----- Original Message ----- 
From: "Ingo Düppe" <ma...@dueppe.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, June 27, 2007 10:13 PM
Subject: Re: Server Node Id


> Well, the reason is, that I need to run some tasks that have to be 
> executed on each node once within the cluster. So each node must be able 
> to identify these tasks that still need to be executed on this node. So in 
> my solution the server node gets its id and checks which was the last task 
> it has executed.
>
> Therefore the id must not change after each startup.
> - Ingo
>
> Johnny Kewl schrieb:
>> Interesting question... I dont know if there is a property one can call.
>> I had a similar need behind a JK load balancing scheme, what I did was 
>> just generate a unique ID when each cluster webapp starts up, something 
>> like the MS GUID idea.
>> No pre-configuration required.
>>
>> I think it would be very interesting to know why you doing this, think 
>> the guys will then really be abe to give you some good idea's.
>>
>>
>> ----- Original Message ----- From: "Ingo Düppe" 
>> <ma...@dueppe.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Wednesday, June 27, 2007 12:07 PM
>> Subject: Server Node Id
>>
>>
>>> Hello,
>>>
>>> i run an application within a tomcat cluster. Now I need a unique key 
>>> for each server node for the application. My first solution was a 
>>> property file within the war file. But this is not so handy on 
>>> deployment cycles.
>>>
>>> Is there a better way to place a unique identify for each cluster node 
>>> or does a identifier already exist.
>>> The id must only be unique within the cluster not globaly.
>>>
>>> Regard
>>> Ingo
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Server Node Id

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Ingo, sounds like some kind of replication scheme.... cant say I understand, 
know it can get complex, I ended up making a dB replication server once to 
try keep clusters independent of each other.
Anyway, what about naturally occuring unique numbers, like the IP address of 
the machine.
That you could stick in the dB and each machine will know it already.
like this for example
String ipaddr = InetAddress.getLocalHost().getHostAddress();
Maybe?

----- Original Message ----- 
From: "Ingo Düppe" <ma...@dueppe.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, June 27, 2007 10:13 PM
Subject: Re: Server Node Id


> Well, the reason is, that I need to run some tasks that have to be 
> executed on each node once within the cluster. So each node must be able 
> to identify these tasks that still need to be executed on this node. So in 
> my solution the server node gets its id and checks which was the last task 
> it has executed.
>
> Therefore the id must not change after each startup.
> - Ingo
>
> Johnny Kewl schrieb:
>> Interesting question... I dont know if there is a property one can call.
>> I had a similar need behind a JK load balancing scheme, what I did was 
>> just generate a unique ID when each cluster webapp starts up, something 
>> like the MS GUID idea.
>> No pre-configuration required.
>>
>> I think it would be very interesting to know why you doing this, think 
>> the guys will then really be abe to give you some good idea's.
>>
>>
>> ----- Original Message ----- From: "Ingo Düppe" 
>> <ma...@dueppe.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Wednesday, June 27, 2007 12:07 PM
>> Subject: Server Node Id
>>
>>
>>> Hello,
>>>
>>> i run an application within a tomcat cluster. Now I need a unique key 
>>> for each server node for the application. My first solution was a 
>>> property file within the war file. But this is not so handy on 
>>> deployment cycles.
>>>
>>> Is there a better way to place a unique identify for each cluster node 
>>> or does a identifier already exist.
>>> The id must only be unique within the cluster not globaly.
>>>
>>> Regard
>>> Ingo
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Server Node Id

Posted by Ingo Düppe <ma...@dueppe.com>.
Well, the reason is, that I need to run some tasks that have to be 
executed on each node once within the cluster. So each node must be able 
to identify these tasks that still need to be executed on this node. So 
in my solution the server node gets its id and checks which was the last 
task it has executed.

Therefore the id must not change after each startup.
- Ingo

Johnny Kewl schrieb:
> Interesting question... I dont know if there is a property one can call.
> I had a similar need behind a JK load balancing scheme, what I did was 
> just generate a unique ID when each cluster webapp starts up, 
> something like the MS GUID idea.
> No pre-configuration required.
>
> I think it would be very interesting to know why you doing this, think 
> the guys will then really be abe to give you some good idea's.
>
>
> ----- Original Message ----- From: "Ingo Düppe" 
> <ma...@dueppe.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Wednesday, June 27, 2007 12:07 PM
> Subject: Server Node Id
>
>
>> Hello,
>>
>> i run an application within a tomcat cluster. Now I need a unique key 
>> for each server node for the application. My first solution was a 
>> property file within the war file. But this is not so handy on 
>> deployment cycles.
>>
>> Is there a better way to place a unique identify for each cluster 
>> node or does a identifier already exist.
>> The id must only be unique within the cluster not globaly.
>>
>> Regard
>> Ingo
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Server Node Id

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Interesting question... I dont know if there is a property one can call.
I had a similar need behind a JK load balancing scheme, what I did was just 
generate a unique ID when each cluster webapp starts up, something like the 
MS GUID idea.
No pre-configuration required.

I think it would be very interesting to know why you doing this, think the 
guys will then really be abe to give you some good idea's.


----- Original Message ----- 
From: "Ingo Düppe" <ma...@dueppe.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, June 27, 2007 12:07 PM
Subject: Server Node Id


> Hello,
>
> i run an application within a tomcat cluster. Now I need a unique key for 
> each server node for the application. My first solution was a property 
> file within the war file. But this is not so handy on deployment cycles.
>
> Is there a better way to place a unique identify for each cluster node or 
> does a identifier already exist.
> The id must only be unique within the cluster not globaly.
>
> Regard
> Ingo
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org