Booting from a Network Server


One very useful command-line option is the --netboot=url option, which causes JBoss to start up using the given URL as the base URL from which all libraries and configurations are loaded. Specifying the netboot option sets ServerConfig.HOME_URL to the netboot option URL argument value. In the absence of any other overrides, all the locations found in the standard JBOSS_DIST structure will be resolved relative to the HOME_URL value. This means that if you make a JBoss distribution available from a web server, you can boot JBoss using only the run scripts and run.jar file from the JBOSS_DIST/bin directory. Note that the web server must support the PROPFIND WebDAV command. JBoss includes a simple servlet filter that provides minimal support for the PROPFIND command so that JBoss itself may be used as the netboot web server.

An Ant build script example that creates a custom netboot configuration file set for booting the default configuration is available in the examples/src/main/org/jboss/chap1/build-netboot.xml file. To test the netboot feature, you run the build-netboot. xml script, specifying the location of the JBOSS_DIST you want to use as the netboot web server, as shown here:

 [examples]$ ant -Djboss.dist=/tmp/jboss-4.0.1 -buildfile src/main/org/jboss/chap1/build-netboot.xml 

You then start up the netboot server by specifying the netboot configuration, as follows:

[View full width]

[bin]$ ./run.sh -c netboot ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /tmp/jboss-4.0.1 JAVA: /System/Library/Frameworks/JavaVM.framework/Home//bin/java JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh CLASSPATH: /tmp/jboss-4.0.1/bin/run.jar:/System/Library/Frameworks/JavaVM.framework/Home //lib/tools.jar ========================================================================= 17:42:52,042 INFO [Server] Starting JBoss (MX MicroKernel)... ... 17:43:06,818 INFO [Server] JBoss (MX MicroKernel) [4.0.1RC2 (build: CVSTag=JBoss_4_0_1_RC2 date=200411302349)] Started in 13s:918ms

You can now start up any other instance of JBoss, using just the run script and run.jar from the JBOSS_DIST/bin directory. Here's an example:

[View full width]

[bin]$ sh run.sh --netboot=http://192.168.0.101:8080/netboot/ ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /tmp/jboss-4.0.1 JAVA: /System/Library/Frameworks/JavaVM.framework/Home//bin/java JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh CLASSPATH: /tmp/jboss-4.0.1/bin/run.jar:/System/Library/Frameworks/JavaVM.framework/Home //lib/tools.jar ========================================================================= 18:14:29,828 INFO [Server] Starting JBoss (MX MicroKernel)... 18:14:29,833 INFO [Server] Release ID: JBoss [Zion] 4.0.1RC2 (build: CVSTag=JBoss_4_0_1_RC2 date=200411302349) 18:14:29,836 INFO [Server] Home Dir: /private/tmp/jboss-4.0.1 18:14:29,838 INFO [Server] Home URL: http://192.168.0.101:8080/netboot/ 18:14:29,840 INFO [Server] Library URL: http://192.168.0.101:8080/netboot/lib/ 18:14:29,869 INFO [Server] Patch URL: null 18:14:29,871 INFO [Server] Server Name: default 18:14:29,874 INFO [Server] Server Home Dir: /private/tmp/jboss-4.0.1/server/default 18:14:29,879 INFO [Server] Server Home URL: http://192.168.0.101:8080/netboot/server/default/ 18:14:29,881 INFO [Server] Server Data Dir: /private/tmp/jboss-4.0.1/server/default/data 18:14:29,884 INFO [Server] Server Temp Dir: /private/tmp/jboss-4.0.1/server/default/tmp 18:14:29,887 INFO [Server] Server Config URL: http://192.168.0.101:8080/netboot/server /default/conf/ 18:14:29,889 INFO [Server] Server Library URL: http://192.168.0.101:8080/netboot/server /default/lib/ 18:14:29,890 INFO [Server] Root Deployment Filename: jboss-service.xml 18:14:29,900 INFO [Server] Starting General Purpose Architecture (GPA)... ...

The custom netboot configuration file set consists simply of the files needed to run the jbossweb-tomcat50.sar web server and a netboot.war file whose content is the JBOSS_DIST/lib and JBOSS_DIST/server/default files.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net