3 Replies Latest reply on Oct 6, 2005 4:50 AM by desmetch

    Multiple JBoss Server Instances on the same system

    sabinafarah

      How does one create Multiple JBoss Server Instances on the same system?

        • 1. Re: Multiple JBoss Server Instances on the same system
          sabinafarah

          DOCUMENT TO CREATE AND RUN DIFFERENT INSTANCES OF JBOSS IN THE SAME MACHINE:

          1. Make a copy of the <jboss_home>/server/default folder within <jboss_home>/server/
          2. Rename the folder to any name viz . ?default1? . this will be the name of ur new JBoss Server instance.
          3. Delete the folders ?log?, ?temp?, ?work? from ?<jboss_home>/server/default1
          4. Download the file jboss-bindings.xml from the url: http://www.jboss.org/wiki/Wiki.jsp?page=JavaStudioCreator
          5. Copy the jboss-bindings.xml into the <jboss_home>/server directory.
          6. We configure the different port bindings for a new instance in this file. {One may have different jboss-bindings.xml for different instances
          or
          all the port bindings may be provided in the same file under different
          tags }
          7. Open <jboss_home>/server/ jboss-bindings.xml
          a. Rename ?server name ? property to ur new server name . viz ?defalut1? . The ports have already been changed as this is a sample bindings file . So the new instance port bindings are ready .
          b. If one wants to create another instance (eg default2) then make a copy of the entire tag. Rename ?server name ? property to ur new server_name and make changes to the port numbers : (eg. one may add 100 to the existing port numbers.)
          A sample is :
          <server name="default2?> <!-- ********************* jboss-service.xml ****************** à <service-config name=?jboss:service=Naming? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?Port? hostName=?BindAddress?> <attribute name=?RmiPort?>1498 </delegate-config> <binding port=?1399? host=?${jboss.bind.address}?/> </service-config> <service-config name=?jboss:service=WebService? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?Port?/> <binding port=?8383?/> </service-config> <service-config name=?jboss:service=invoker,type=jrmp? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?RMIObjectPort?/> <binding port=?4744?/> </service-config> <service-config name=?jboss:service=invoker,type=pooled? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?ServerBindPort?/> <!?don?t care for now à <binding port=?0?/> </service-config> <!-- ********************* cluster-service.xml **************** à <service-config name=?jboss:service=HAJNDI? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?Port?/> <binding port=?1400?/> </service-config> <service-config name=?jboss:service=invoker,type=jrmpha? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?RMIObjectPort?/> <binding port=?4745?/> </service-config> <!-- ********************* iiop-service.xml ****************** à <service-config name=?jboss:service=CorbaORB? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?Port?/> <binding port=?3828?/> </service-config> <!-- ********************* jmx-rmi-adaptor.sar **************** à <service-config name=?jboss.jmx:type=Connector,name=RMI? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?RMIObjectPort?/> <binding port=?19301?/> </service-config> <!-- ********************* snmp-adaptor.sar ****************** à <service-config name=?jboss.jmx:name=SnmpAgent,service=trapd,type=logger? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?Port?/> <binding port=?1462?/> </service-config> <!-- ********************* jbossmq-service.xml **************** à <!?JMS related services à <!?service-config name=?jboss.mq:service=InvocationLayer,type=RMI? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate? > <delegate-config portName=?ServerBindPort? /> <binding port=?8289? /> </service-configà <service-config name=?jboss.mq:service=InvocationLayer,type=OIL? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?ServerBindPort?/> <binding port=?8390?/> </service-config> <service-config name=?jboss.mq:service=InvocationLayer,type=OIL2? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?ServerBindPort?/> <binding port=?8392?/> </service-config> <service-config name=?jboss.mq:service=InvocationLayer,type=UIL2? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate?> <delegate-config portName=?ServerBindPort?/> <binding port=?8393?/> </service-config> <!-- ********************* hsqldb-ds.xml ********************** à <!?Hypersonic related services Only if using TCP setup (local file setup by default) <service-config name=?jboss.jca:service=ManagedConnectionFactory,name=DefaultDS? delegateClass=?org.jboss.services.binding.XSLTConfigDelegate? > <delegate-config> <xslt-config configName=?ManagedConnectionFactoryProperties?><![CDATA[<xsl:stylesheet xmlns:xsl=?http://www.w3.org/1999/XSL/Transform? version=?1.0?> <xsl:output method=?xml? /> <xsl:param name=?host?/> <xsl:param name=?port?/> <xsl:template match=?/?> <xsl:apply-templates/> </xsl:template> <xsl:template match=?config-property[@name=?ConnectionURL?]?> <config-property type=?java.lang.String? name=?ConnectionURL?>jdbc:hsqldb:hsql://<xsl:value-of select=?$host?/>:<xsl:value-of select=?$port?/></config-property> </xsl:template> <xsl:template match=?*|@*?> <xsl:copy> <xsl:apply-templates select=?@*|node()?/> </xsl:copy> </xsl:template></xsl:stylesheet>]]> </xslt-config> </delegate-config> <binding host=?localhost? port=?1901? /> </service-config> <service-config name=?jboss:service=Hypersonic? delegateClass=?org.jboss.services.binding.AttributeMappingDelegate? > <delegate-config portName=?Port? /> <binding port=?1901? /> </service-config>à <!-- ********************* jbossweb-tomcat.sar ***************** à <service-config name=?jboss.web:service=WebServer? delegateClass=?org.jboss.services.binding.XSLTFileDelegate?> <delegate-config> <xslt-config configName=?ConfigFile?><![CDATA[<xsl:stylesheet xmlns:xsl=?http://www.w3.org/1999/XSL/Transform? version=?1.0?> <xsl:output method=?xml? /> <xsl:param name=?port?/> <xsl:variable name=?portAJP? select=?$port ? 71?/> <xsl:template match=?/?> <xsl:apply-templates/> </xsl:template> <xsl:template match = ?Connector?> <xsl:for-each select=?@*?> <xsl:choose> <xsl:when test=?(name() = ?port? and . = ?8080?)?> <xsl:attribute name=?port?><xsl:value-of select=?$port? /></xsl:attribute> </xsl:when> <xsl:when test=?(name() = ?port? and . = ?8009?)?> <xsl:attribute name=?port?><xsl:value-of select=?$portAJP? /></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name=?{name()}?><xsl:value-of select=?.? /></xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template> <xsl:template match=?*|@*?> <xsl:copy> <xsl:apply-templates select=?@*|node()?/> </xsl:copy> </xsl:template></xsl:stylesheet>]]></xslt-config> </delegate-config> <binding port=?8380?/> </service-config>

          8. Open the file <jboss_home>/server/<server_name>/conf/jboss-service.xml
          a. For the new server uncomment the mbean < /mbean >
          b. Change the attribute name ?ServerName? from default to your server_name . viz ?default1?
          c. Point the attribute ?StoreURL? to the jboss-bindings.xml file.
          A sample is :
          default1 ../server/jboss-bindings.xml org.jboss.services.binding.XMLServicesStoreFactory
          9. Open <jboss_home>\server\server_name\conf \jndi.properties .
          a. Edit ? java.naming.provider.url=localhost:1399? . Provide the port number that was specified in jboss.bindings.xml for the attribute <service-config binding port ="" > .
          For the server default1 the binding port specified is 1199.
          For the server default2 , the binding port we specified was 1399.
          10. Now we have two instances ready . One is default and the other is default1
          11. You can start both the servers by running the command
          < jboss_home>\ > run ?c default
          < jboss_home>\ > run ?c default1
          12. In this way as many Jboss Server insatnces may be created.

          • 2. Re: Multiple JBoss Server Instances on the same system
            sabinafarah

            replace ? with - in the run command