How to run multiple instances of JBoss in a one single machine?

前端 未结 9 1587
眼角桃花
眼角桃花 2020-12-07 23:30

I need to run multiple(more than 4) instances of JBoss server on a single machine. I am using JBoss 4.2.3 GA.

相关标签:
9条回答
  • 2020-12-08 00:05

    Create multiple loopback adapters and bind each ip address to different instance.

    No need of changing port.

    RK

    0 讨论(0)
  • 2020-12-08 00:08

    Copy complete JBOSS setup to new location, and start new server with offset option, which will start server on existing ip and changing port to previously_configured_port+offset

    standalone.bat -c standalone-full.xml -Djboss.socket.binding.port-offset=100

    This command will make default jboss console 9990 to 10090

    Now you can add your war file in new deployments folder and start deployment on new port

    0 讨论(0)
  • 2020-12-08 00:11

    The quickest and easiest way that comes into mind is simply configuring multiple IP addresses to the hosting machine. Then you can use the different IP addresses to bind to each instance. Doing this means you don't have to change any default ports and allows for an easier environment to manage.

    0 讨论(0)
  • 2020-12-08 00:14

    I found the answer. We have to configure the jboss-service.xml to run multiple instances in the same machine.

    We may need to keep the same "default" instance same as it is under the JBOSS_HOME\Server.

    We have to create another folder say "instance2" under JBOSS_HOME\Server. Copy all the contents from JBOSS_HOME\Server\default to this newly created folder.

    Now goto conf folder under JBOSS_HOME\Server\instance2 directory. Edit the jboss-service.xml. Search for mbean code="org.jboss.services.binding.ServiceBindingManager" in this configuration file.

    By default this xml tag is commented. We have to un comment it and change the value ports-00 to ports-01.

    Then start this instance2 jboss instance. We can access this application by using the port number 8180.

    We can go for at maximum of 3 instances with this way.

    To run more than this we have to add some more running tags in JBOSS_HOME\docs\examples\binding-manager\sample-bindings.xml.

    0 讨论(0)
  • 2020-12-08 00:14

    You can make things a lot simpler by simply changing the IP that the server is bound to.

    You will need to copy the entire jboss folder several times and configure run.bat to use the -b parameter on startup.

    If this is a Windows server and you're running jboss as a service, you might want to edit the service.bat for each instance too so that the servers all have different names in the services control panel.

    Part of the problem we ran into when trying to use different HTTP ports was that jboss uses 'lots' of ports for different purposes and it was a pain to edit all of these port numbers to be unique on each instance. By changing the bind address you can avoid this problem entirely.

    0 讨论(0)
  • 2020-12-08 00:22

    1) Copy the default folder with new name: instance name

    2) In jboss-service.xml Uncomment the ServiceBindingManager mbean and change the ServerName to ports-01 or 02 or 03 e.g:ports-01 and ports-01/02/03 configuration should be there in sample-bindings.xml(present in docs/examples/binding-manager) And make the changes in all the ports mentioned under ports-01/02/03 tags, So that ports will not get conflict. Remember the server will run on the binding port like 8080/8180/8182.

    from cmd promt go to the bin folder and run the instances with cmd:

    run -c instancename

    0 讨论(0)
提交回复
热议问题