Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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


In some cases, mostly because of 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 a different binding port.

Getting ready

First of all, we need to create a standalone configuration for each instance that we want to set up and run. All we need to do is replicate the concept explained in the Running WildFly from a custom configuration folder recipe. Suppose we want two running nodes/instances, we use the following commands:

$ cd $WILDFLY_HOME
$ cp -a standalone node-1
$ cp -a standalone node-2

Now we are ready to configure each instance.

How to do it…

To achieve such a requirement, you can use either of the methods explained earlier in the Binding WildFly on a custom port recipe. Let's take a look at each of them.

Using jboss.http.port

The first thing to try is to run the two WildFly instances by passing the parameter...