Making multiple jboss instances easier
didickman Nov 1, 2004 3:02 PMSetting up multiple JBoss instances on one machine is quite important in an enterprise setting. I propose making this task easier to do by carrying out a few simple steps to the default download of JBoss. (example below is versus JBoss 3.2.5).
First, we should copy $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml to $JBOSS_HOME/server/{all,default}/conf/service-bindings.xml.
Next, we should apply the patch below to the jboss-service.xml file that lives under both all/conf and default/conf:
--- jboss-3.2.5/server/all/conf/jboss-service.xml Fri Jun 25 22:22:48 2004 +++ jboss-3.2.5.new/server/all/conf/jboss-service.xml Mon Nov 1 14:14:58 2004 @@ -83,7 +83,7 @@ <!-- Service Binding --> <!-- ==================================================================== --> - <!-- Automatically activated when generatting the clustering environment --> + <!-- Automatically activated when generating the clustering environment --> <!-- @TESTSUITE_CLUSTER_CONFIG@ --> <!-- @@ -100,18 +100,16 @@ | during initialization that specifies how to connect to the bindings store. | StoreFactory: The org.jboss.services.binding.ServicesStoreFactory interface | implementation to create to obtain the ServicesStore instance. + --> <mbean code="org.jboss.services.binding.ServiceBindingManager" name="jboss.system:service=ServiceBindingManager"> - <attribute name="ServerName">ports-01</attribute> - <attribute name="StoreURL">../docs/examples/binding-manager/sample-bindings.xml</attribute> + <attribute name="ServerName">${jboss.server.ports}</attribute> + <attribute name="StoreURL">${jboss.server.home.dir}/conf/service-bindings.xml</attribute> <attribute name="StoreFactoryClassName"> org.jboss.services.binding.XMLServicesStoreFactory </attribute> </mbean> - - --> - <!-- ==================================================================== --> <!-- Class Loading -->
Making these changes to the default download of JBoss doesn't change anything for people using only a single instance per machine. But once we want to move to multiple instances per machine, we can reduce things to: 'run.sh -Djboss.server.ports=ports-01'. (We just need to modify the java code so that 'jboss.server.ports' defaults to 'ports-default' and add error handling in case ports-default is not defined).