Wednesday, August 13, 2014

Recent visitors more visitors


Many modules need to run independently in the actual development process, they will not publish to web forms, the traditional approach is to be compressed into jar package run independently, this form is also more conducive to easy maintenance, but once the server is restarted or appear exception, the program often unable to repair or restart. Resolve server restarts traditional practices is to write a shell script to start and run with the server, but doing so is only a temporary, then we want to find a "cure" way how to do it? Java Service Wrapper is easy and simple for us to solve these problems. "Java Service fumoire Wrapper" As the name suggests, our Java program packaged as a system service, such as the operation of the system can be automatically run, of course, Java Service Wrapper (below referred Wrapper) function must not stop there.
tree / f displays the directory structure is as follows:. wrapper-linux-x86 jdoc.tar.gz // javadoc file README_de.txt // Description README_en.txt // Description README_es.txt // Description README_ja.txt / / Description bin // execute the file directory demoapp // sample program testwrapper // test program wrapper // main (important) conf // profile directory demoapp.conf // sample configuration File wrapper.conf // main configuration file (important, the file name can be modified) doc // documentation directory index.html // Home revisions.txt // Imprint wrapper-community-license- 1.1.txt // License Agreement jdoc // javadoc documentation directory index.html // Home lib // rely library catalog libwrapper.so // wrapper linux file (.so: user layer dynamic library) wrapper.jar // wrapper main (important) wrapperdemo.jar // sample program wrappertest.jar // test program fumoire logs // log directory wrapper.log // log files src // source code directory bin // execution directory sh.script.in // shell script source code (important) conf // configuration directory wrapper.conf.in // original configuration see Wrapper There are so many benefits, then we passed Wrapper comes Wrapper sample program to learn more about it: Create a working directory services to the operating system Linux, the directory structure for usr / local / wrapper example, according to the directory structure above , under which create "bin", "conf", "lib", "logs" file folder four of the same name. 2 configuration and program files are copied to the appropriate directory (which is above standard files); Copy wrapper file (1) bin directory fumoire to the next usr / local / wrapper / bin. (2) src \ bin directory under the file copy sh.script.in to the next usr / local / wrapper / bin, and .in delete and modify the name suffix, modified for javaService.script. (3) Copy wrapper.conf file conf directory to the next usr / local / wrapper fumoire / conf. (4) Copy wrapper.jar and libwrapper.so file lib directory to the next usr / local / wrapper / lib. Note: The above is required to file a formal configuration environment, where we need to run the Wrapper comes with the demo program, so you need to demoapp, copy demoapp.conf, wrapperdemo.jar these three files to the appropriate directory. 3 into the bin directory execute the following command:
Log contents shows that our system is not installed Linux graphical interface or no graphics.
Usage: ./ program name [console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | status | install | remove | dump] Commands:. Console fumoire Launch in the current console start Start in the background as a daemon process. stop Stop if running as a daemon fumoire or in another console. restart Stop if running and then start. condrestart Restart only if already running. status Query the current status. install Install to start automatically when system fumoire boots. remove Uninstall . dump Request a Java thread dump if running JavaAppArgs:. Zero or more arguments which will be passed to the Java application.
Commands: fumoire console launch and display console messages start as a background daemon start stop stop a program restart to restart the program condrestart restart the program has been running, with the former difference is that the program must already running status fumoire to view the status of the program installed to install the program from the start service, which starts from the start and start remove uninstall Java thread dump dump report service with runtime system (thread dump Baidu Encyclopedia: http: //baike.baidu.com/view/5111187.htm)
Because the wrapper is running the main program Wrapper is the core, he can not run alone through src / bin in sh.script.in this shell script calls, the use of this document will be talked about behind us. Run wrapper above tips can add parameters, such as: ./ wrapper -c wrapper.properties above is for an overall understanding Wrapper hope this article can help you get started faster and use Wrapper, after a few articles will explain in detail Wrapper configure and customize their own applications.
Recent visitors more visitors >>
Articles Category fumoire All blog (130) I know Java (53) of the first chapter (6) Chapter II (a) Chapter IV (23) web (19) tomcat (10) java (36) j2ee (17) javaee (14) Section III (15) Chapter VII (19) Section 7 (4) V (8) Section (19) Project Tools (1) Chapter V (2) IV (1) Section (a) Section VI (2) dasfdsaf (0) Hibernate (1)
Latest Comments seraph_fd: Amazing! I really still reading less ah! get, put, post, delete fumoire the meaning and difference yangnuowei88: add up to your popularity, ha ha, boss. You write drops quite often, and I rarely good, insisted on not ... Java stack memory (Stack) lliiqiang: But we can not use the same random synchronization session identifier and security does not simulate a theft of state ... HTTP stateless protocol and session principle Duke 600: high-end atmosphere on the grade! ! ! Simple fumoire and elegant CSS dialog / message box / pop-up box tkl211: fumoire very cool, looking forward to the landlord and slowly add other features, ha ha simple and elegant CSS dialog / message box / pop-up box


No comments:

Post a Comment