Configuring multiple WildFly instances to run on the same machine with different IPs

In some cases, mostly due to architectural reasons, you may need to run multiple WildFly instances on a single server. You can do this by isolating each instance and giving it different binding IPs. The IPs might be virtual or effectively provided by the physical network interfaces installed on your system. Either way is good.

Getting ready

If you decide on virtual IPs, you can do this as follows:

$ sudo ifconfig YOUR_NIC:1 10.0.1.1 netmask 255.255.255.0
$ sudo ifconfig YOUR_NIC:2 10.0.1.2 netmask 255.255.255.0

Here YOUR_NIC might be eth0. Now, if you list all the available interfaces in your server, you will also see the following new ones:

$ ifconfig eth0: flags=4099<UP,BROADCAST,MULTICAST> ...

Get WildFly Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.