Java Reference
In-Depth Information
Deploying and testing high availability
Deploying an application to a cluster can be achieved in several ways; if you prefer auto-
mation instead of manually copying each archive into the deployments folder, you can
reuse the CLI deployment script contained in the previous chapter.
Alternatively, if you are using the WildFly Maven plugin to deploy, you can parameterize
its configuration, including the hostname and the port as variables, which will be passed
to the command line:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<filename>${project.build.finalName}.jar</filename>
<hostname>${hostname}</hostname>
<port>${port}</port>
</configuration>
</plugin>
Therefore, you will use the following shell to compile the package and deploy the applica-
tion on the first node:
mvn install wildfly:deploy -Dhostname=localhost -Dport=9999
For the second node, you will use the following:
mvn install wildfly:deploy -Dhostname=localhost -Dport=10194
Note
Deploying the application in the domain node works the same as mentioned in the preced-
ing example, except that you need to add the domain tag to your configuration and need
to specify at least one server group. Visit https://docs.jboss.org/wildfly/plugins/maven/
latest/examples/deployment-example.html for more information.
Once you have deployed both the applications on your server node, you should be able to
see the cluster view in the server console logs and also see that the Infinispan cache has
Search WWH ::




Custom Search