|
From: <da...@sm...> - 2006-07-10 14:07:35
|
But one of the thoughts he had was to create the pid file on a network =20 accessable directory, so that both machines could use the same =20 physical location, and thus only one file existing. Quoting Leif Mortenson <le...@ta...>: > Martyn, > You would have to modify the shell script a bit. But you could > place the pid file > mentioned in the shell script on the network share. You would have to > change the > logic a bit however as the file is currently ignored if the process in > the pid file does > not exist. It wouldn't exist on the other machine of course. > > Cheers, > Leif > > Martynas Brijunas wrote: >> Hi Leif, >> >> thank you for your answer. >> >> The processes are started manually by an operator. Or they can be >> started automatically on one server, and manually on another. So that >> would eliminate the problem of a power outage you mentioned. >> >> I was hoping that by detecting an existing PID file (for example, on a >> network share), the wrapper would refuse to start on another server, >> until this original PID file is removed. >> >> Martyn >> >> >> 2006/7/10, Leif Mortenson <le...@ta...>: >> >>> 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 =20 >>>> 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. >>>>>> >>>>>> > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job eas= ier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > |