|
From: Leif M. <lei...@ta...> - 2010-10-01 21:20:54
|
Kapilashantha, Hmmm. The Wrapper will be running on both of your servers, so you really don't want to monitor that PID file. It is possible to tell the Wrapper to write out a number of other state files however. One is the JVM PID file. This will contain the PID of the JVM when it is running. It sounds like the way you have things set up now, the JVM will also always be running however. http://wrapper.tanukisoftware.com/doc/english/prop-java-pidfile.html We can also write out the status of both the Wrapper and Java processes. These are useful when you want to know exactly what state the processes are in internally. http://wrapper.tanukisoftware.com/doc/english/prop-statusfile.html http://wrapper.tanukisoftware.com/doc/english/prop-java-statusfile.html One feature that might be useful is the ability to "pause" the Wrapper. When paused, it can be configured to completely stop the JVM process and then wait for a signal to resume. When paused, the above JVM PID file and status files will be missing so your monitoring system could trigger off of this possibly. http://wrapper.tanukisoftware.com/doc/english/prop-pausable.html Now, to control the paused/resume state of the Wrapper, your can specify a command file. The Wrapper will poll this file and then take any action that is stored in the file. These can be commands like STOP, RESTART, PAUSE, RESUME, amongst others. http://wrapper.tanukisoftware.com/doc/english/prop-commandfile.html Would it be possible to set up your system to write these command files on the two servers to control their states? It is possible for your Java code to pause its own JVM by calling exiting with an exit code that you then tie to a PAUSE action with the on_exit property: http://wrapper.tanukisoftware.com/doc/english/prop-on-exit-n.html We have also added a new property to version 3.5.5 that will make it possible to start the Wrapper in a paused state so it will not launch its first JVM until it is resumed. wrapper.pause_on_startup=TRUE wrapper.pausable=TRUE Please let me know if you have any ideas of how you would ideally like the Wrapper to behave. We are always interested in finding ways to make the Wrapper more useful. Cheers, Leif On Tue, Sep 28, 2010 at 1:04 PM, kapilashantha rajapaksha <kap...@gm...> wrote: > Dear Sir, > > Thanks a lot your kind response, > > I'm using RHEL 5.4 operating system and my application is a transaction > server which is basically installing in banking system. > > So I have two servers mentioned LIVE and BACKUP > > And I'm using LINUX HA (heartbeat) to make a backup processes. > > Note : I extends the 'WrapperSimpleApp' in my application and using it > > > My issue is that my service (running on wrapper) something different not > like other service (For a example take httpd service) > > The reason is when starting failing of service (it means init() method > returns false ), The linux HA is still detecting that service is still > running status. > > Note : I'm using HA service monitoring option to monitor service status > > Then service will not move to the BACKUP server even if it is getting > failure in LIVE server. But same configuration I have been applying to httpd > service, so HA try to three attempts to start service on LIVE server if it > is failing there, the httpd service will move to the backup server. > > > My point is that when I run my service, imediatly it will create PID file > and others but application is still initializing. So HA now detecting > service is running > > Anyway i trust that you can understand my problem. > > > This is the using code > > ----------------------------------------------------------------------------- > > package com.epic.line.server; > > import org.tanukisoftware.wrapper.WrapperSimpleApp; > import com.epic.line.config.TLEConfig; > import com.epic.line.config.TLEInitAll; > > public class WrapperStart extends WrapperSimpleApp { > > protected WrapperStart(String[] arg0) { > > super(arg0); > > } > > > public static void main(String[] args) { > > try { > > TLEInitAll.init(); > > if (TLEConfig.INIT_ST){ > > System.out.println( "Epic_TLE startup passed." ); > new WrapperStart(args); > > > }else{ > > System.out.println( "Epic_TLE startup failed." ); > System.exit(0); > > } > } catch (Exception e) { > > > } > > > } > > > @Override > public int stop(int exitCode) { > > return super.stop(0); > } > > > } > > ----------------------------------------------------------------------------- > > Note : Passing my main method via args > > > And one thing with this code > > When calling 'TLEInitAll.init();' wrapper has created PID file and other > before calling 'new WrapperStart(args);' > > Thanks and regards > -Kapila > > > > On Mon, Sep 27, 2010 at 10:57 PM, > <wra...@li...> wrote: >> >> Send Wrapper-user mailing list submissions to >> wra...@li... >> >> To subscribe or unsubscribe via the World Wide Web, visit >> https://lists.sourceforge.net/lists/listinfo/wrapper-user >> or, via email, send a message with subject or body 'help' to >> wra...@li... >> >> You can reach the person managing the list at >> wra...@li... >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Wrapper-user digest..." >> >> >> Today's Topics: >> >> 1. Taking chance to call my init() before running on JSW >> (kapilashantha rajapaksha) >> 2. Re: Taking chance to call my init() before running on JSW >> (Leif Mortenson) >> 3. Wrapper service failing immediately >> (GLOVER, MARK CSC) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 27 Sep 2010 13:09:50 +0530 >> From: kapilashantha rajapaksha <kap...@gm...> >> Subject: [Wrapper-user] Taking chance to call my init() before running >> on JSW >> To: Wra...@li... >> Message-ID: >> <AAN...@ma...> >> Content-Type: text/plain; charset="iso-8859-1" >> >> hi All, >> >> I'm using int JSW for my application. One thing I want to know. >> >> I want to run my init() method (There is an init() method in my >> application >> which used for checking initializing modules like dbconnection, some >> hardware status (HSM), remote socket connection status etc... ). If it is >> returning TRUE, the all modules are successfully loaded. If it is retuning >> FALSE, some failure has detected. >> >> What I want to know, >> >> Can I call my init() method before loading JSW ? >> >> If only TRUE returns , Then my application should be get started on JSW >> >> >> Regards >> -Kapila >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> >> ------------------------------ >> >> Message: 2 >> Date: Mon, 27 Sep 2010 16:49:56 +0900 >> From: Leif Mortenson <lei...@ta...> >> Subject: Re: [Wrapper-user] Taking chance to call my init() before >> running on JSW >> To: wra...@li... >> Message-ID: >> <AAN...@ma...> >> Content-Type: text/plain; charset=ISO-8859-1 >> >> Kapila, >> You can do this in one of a number of ways. >> >> 1) The simplest is to write a simple class which does this check in >> its main method then calls the application's main class's main method >> if you really want to start the application. Call System.exit with >> an appropriate error code otherwise. >> You can then use the standard Integration Method #1 and make use of >> the WrapperSimpleApp helper class as usual: >> http://wrapper.tanukisoftware.com/doc/english/integrate.html#method1 >> >> 2) A more advanced option is to use Integration Method #3, and write >> your own WrapperListener implementation. In this case, you would do >> your initialization checks in the WrapperListener.start method and >> then return an error or call your main class start method as above. >> This method has the benefit of giving you more control over when the >> Wrapper things the application is "started": >> http://wrapper.tanukisoftware.com/doc/english/integrate.html#method3 >> >> Cheers, >> Leif >> >> On Mon, Sep 27, 2010 at 4:39 PM, kapilashantha rajapaksha >> <kap...@gm...> wrote: >> > hi All, >> > >> > I'm using int JSW for my application. One thing I want to know. >> > >> > I want to run my init() method (There is an init() method in my >> > application >> > which used for checking initializing modules like dbconnection, some >> > hardware status (HSM), remote socket connection status etc... ). If it >> > is >> > returning TRUE, the all modules are successfully loaded. If it is >> > retuning >> > FALSE, some failure? has detected. >> > >> > What I want to know, >> > >> > Can I call my init() method before loading JSW ? >> > >> > If only TRUE returns , Then my application should be get started on JSW >> > >> > >> > Regards >> > -Kapila >> >> >> >> ------------------------------ >> >> Message: 3 >> Date: Mon, 27 Sep 2010 13:26:51 -0400 >> From: "GLOVER, MARK CSC" <MAR...@UT...> >> Subject: [Wrapper-user] Wrapper service failing immediately >> To: <wra...@li...> >> Message-ID: >> <8D3...@UU...> >> Content-Type: text/plain; charset="iso-8859-1" >> >> What might cause a wrapper to exit before trying to start? >> >> Running from console doesn't seem to indicate error. >> >> C:\Documents and >> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>wrapper.exe >> -c ..\conf\MarkTestWrapperApp.conf >> >> n See wrapper.log for results. >> >> >> >> The service is not waiting 30000 milliseconds for a process to start. >> >> The service failing immediately. >> >> M/S documentation suggests error code WIN32_EXIT_CODE : 0 (0x0) is >> caused by a bug before the process is starting. >> >> >> >> C:\Documents and >> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>InstallMarkTestWrapperApp-NT.bat >> >> wrapper | Service command: "C:\Documents and >> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin\wrapper.exe" >> -s "C:\Documents and >> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\conf\wrapper.conf" >> >> wrapper | MarkTestWrapperApp service installed. >> >> >> >> C:\Documents and >> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>wrapper.exe >> -t ..\conf\MarkTestWrapperApp.conf >> >> wrapper | Starting the MarkTestWrapperApp service... >> >> wrapper | Unable to start the MarkTestWrapperApp service - The service >> did not respond to the start or control request in a timely fashion. (0x41d) >> >> >> >> C:\Documents and >> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>sc query >> MarkTestWrapperApp >> >> >> >> SERVICE_NAME: MarkTestWrapperApp >> >> TYPE : 10 WIN32_OWN_PROCESS >> >> STATE : 1 STOPPED >> >> >> (NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN) >> >> WIN32_EXIT_CODE : 0 (0x0) >> >> SERVICE_EXIT_CODE : 0 (0x0) >> >> CHECKPOINT : 0x0 >> >> WAIT_HINT : 0x0 >> >> >> >> >> >> >> >> Mark Glover >> >> UTC Power >> >> 195 Governors Highway >> >> South Windsor CT 06074 >> >> 860 727 2253 |