In this recipe, you will learn how to cluster two WildFly nodes locally, that is, on your PC. We will try this using the domain mode and the ha
profile.
For this recipe, we will need the cluster-aware
application named cluster-test
, 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, run the following commands:
$ cd ~/WFC/github/wildfly-cookbook $ cd cluster-test $ mvn -e clean package
From the WildFly installation directory $WILDFLY_HOME
, let's create two folders; one representing the domain-controller
and the other one representing the hosts (we will have two instances running within the same host).
Open a terminal and execute the following commands:
$ cd $WILDFLY_HOME $ cp -a domain cl-dmn-master $ cp -a domain...