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

Creating a cluster via TCP


Often times, especially in enterprise and cloud environments where there are several restrictions among networks, you are not able to use multicast addresses, even in the same network. Fortunately, the jgroups subsystem helps you out with this by providing an easy way to switch between UDP and TCP clustering, and this is exactly what you will learn in this recipe. We will work using the standalone mode with the ha profile.

Getting ready

For this recipe, we will need the "cluster-aware" application named "example", that you can find in my GitHub repository. If you skipped the Managing applications using the deployments folder recipe in Chapter 2, Running WildFly in Standalone Mode, please refer to it to download all the source code and projects that you will need.

To build the application, do as follows:

$ cd ~/WFC/github/wildfly-cookbook
$ cd example
$ mvn -e clean package

How to do it...

From the WildFly installation directory $WILDFLY_HOME, let's create two folders...