I want to simulate 2 servers by running 2 independent instances of Wildfly. This is useful when you don't want to deploy all WARs on the same instance and then only be able to shut them down and start them together.
I'm using Eclipse with the JBoss plugin where in the Servers view I want to have 2 Wildfly servers that I can stop and run separately and simultaneously. How do I do that?
It's possible to duplicate your Wildfly installation folder, but that takes up more space and you would need to update both for every change. Instead it's possible to share the root folder and just create 2 standalones:
standalone1
and standalone2
folders from the default (or use the default as one of them).deployments
folder you can choose whichever deployments you need.For the ports not to conflict, the configuration/standalone.xml
of one of the standalones must be changed as shown here: change the number from 0 to something else like 200
port-offset="${jboss.socket.binding.port-offset:200}
Now go to Eclipse and in the Servers view create a new Server. Give it some suitable name and click next.
create new runtime
on the bottom dropdown menu and click next.Server base directory
choose the standalone folder name you want, like standalone1
above.Do the same for other instances with different offsets (in the above 1 instance will be at 8080 and the other at 8280).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With