twitter
    !! Tell us what you want to Learn / Know !!

Instance / Managed Server

When you install JBoss you will get three server configurations with it.
  
     minimal
         This is the bare minimum to start JBoss. It contains logging, JNDI server and URL deployment scanner to find new deployments. There is no web container, no EJB container or JMS.
  
     default
          This is the default server environment that is started when no server parameter is specified in the run script. It contains everything you need to run a stand-alone J2EE server. It does not include RMI/IIOP, clustering services and the web-services deployer. If you do not know which configuration to use, I recommend using default.

     all
         Contains all available services.

Creating an Instance:
Creating an instance in JBoss is nothing but creating your own server configuration. It is easy to create your own Server Configuration. Simply copy one of the existing directory trees and give it a new name.

For Example copy default folder and rename it as Instance1

The JBoss application server uses numerous ports for different services. All the three server configurations have the same ports by default. If you try to run any two servers at a time, you will get port binding exceptions. So you need to change the ports of the servers.

You can change the ports manually or you can use the port sets shipped with JBoss.

The sample-bindings.xml in JBoss_Home /docs/examples/binding-manager contains the default port sets.

Changing the ports:

Step1:
      Open the jboss-service.xml from JBoss_Home/server/serverName/conf folder. This is the main configuration file for JBoss.

Step2:
      Search for the following mbean


<mbean code=”org.jboss.services.binding.ServiceBindingManager”
Uncomment this mbean.

Step3:
        Change the port set, you can use ports-01 or ports-02 or ports-03 or even ports-default
   
        <attribute name=”ServerName”>ports-01</attribute>

Step4:
        Navigate to the following location

        JBoss_Home/server/Instance1/deploy/jboss-web.deployer and open server.xml

Step5:
       Search for the following
   
       <Engine name="jboss.web" defaultHost="localhost" >
  
       Add jvmRoute to it

       <Engine name="jboss.web" defaultHost="localhost" jvmRoute="Instance1">

       Similarly you can create your own port sets.

Starting JBoss/Instance:
          Open a command prompt and navigate to the following location

          JBoss_Home/bin


The above command will start the server with default configuration; I mean default server will be started.

Starting a server with different configuration:
          Open a command prompt and navigate to the following location
     
          JBoss_Home/bin


The above command will start the server named Instance1.
-c means configuration.


0 comments:

Post a Comment