|
From: Leif M. <le...@ta...> - 2006-07-10 08:14:11
|
Martyn,
The problem is that you are talking about two physical machines.
The Wrapper has
features do this within a single machine. But not for multiple
machines. You will need to
implement a startup class which say attempts to open a socket to the
other machine. If
it connects, it knows the other server is running and shuts down. If
it fails to connect then
it can assume it opens its own server socket to listen for connections.
This is not fail proof however. You need to account for cases where
both servers come
up at pretty much the same instant. Say after a power outage or
something. Maybe make
server a the master. It will always try to run. Server B will try to
start but then poll Server
A and always shutdown if it finds it. Something like that.
But like was already said, I don't think this is really under the
scope of the wrapper
unless I am missing what you are trying to say.
Cheers,
Leif
Martynas Brijunas wrote:
> Hi Martin,
>
> thank you for your reply. I think i explained the problem not very clearly.
>
> Server A: process AAA is running
> Server B: process AAA must not be running if it is running on Server
> A, otherwise it can.
>
> How to ensure that when it is running on Server A, it cannot be
> started on Server B? And vice versa: when it is running on Server B,
> it cannot be started on Server A.
>
> Is it possible to emply PIDs or anchor files for this purpose?
>
> Thanks,
> Martyn
>
> 2006/7/7, Martin Gazak <ma...@mi...>:
>
>> Hallo,
>> this seems not to be a task for Java Service Wrapper - try to look for
>> example at www.linux-ha.org (Linux/Unix environment only, but seems to
>> be your case), you may achieve also failover of the service (including
>> the IP failover).
>>
>>
>>
>> Martynas Brijunas wrote:
>>
>>> Hi,
>>>
>>> we have 2 servers that have the same wrapper services for failover
>>> reasons. Only one instance of each server can run at any given time.
>>> Is there a way to prevent an accidental start of a service in 2
>>> locations? I thought of employing a PID file on a network share, but
>>> not sure if that would work.
>>>
>>> Thank you.
>>>
|