2

I need to run multiple instance of wildfly server on the same IP with different port offset. I have followed all steps as given in wildfly guide.

Here is what i did. Firstly i created standalone2 for new instance

I copied /wildflyhome/standalone to /wildflyhome/standalone2

Then I started the first instance as follows

/bin/ ./standalon.sh -Djboss.server.base.dir=$JBOSS_HOME/standalone/  server-config=standalone-full.xml

Its getting started properly. When i access it its loading Admin console and other deployed apps without any problem

Then I started second instance as follows

./standalone.sh -Djboss.server.base.dir=$JBOSS_HOME/standalone2/ -Djboss.socket.binding.port-offset=100 -Djboss.node.name=node1 --server-config=standalone-full.xml

It shows that its started with the following messages in logs:

Http management interface listening on http://127.0.0.1:10090/management
[org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:10090
[org.jboss.as] (Controller Boot Thread) JBAS015875: WildFly 8.2.0.Final "Tweek" started 

After this when i try to access admin console on 10090 port or try to access deployed apps it gives error that the connection has timed out.

Can anyone tell me what i am doing wrong here.

kirti
  • 4,499
  • 4
  • 31
  • 60

1 Answers1

2

I have found solution to this. To create Multiple instance of wildfly:

1)Go to wildfly home -  copy standalone folder and name it standalone2

2)Start first instance normally

3) To start second instance :
./standalone.sh -Djboss.server.base.dir=$JBOSS_HOME/standalone2/ -Djboss.socket.binding.port-offset=100 -Djboss.node.name=node1 --server-config=standalone-full.xml

offset gives port at which second instance will be operated : 8080 + 100 = 8180 and landing page is now accessible at localhost:9080 (8080+1000)

Now after this to do load balancing you will need to configure virtual hosts either in apache or nginx (whatever you are using) to divert the traffic to the required server instance. For more information check this url https://vimeo.com/104555966

kirti
  • 4,499
  • 4
  • 31
  • 60