4

How can i set-up

multiple nodes of WildFly in a single machine in Clustered mode ?

Should i create multiple Standalone nodes or multiple Domain nodes if I want to create all these multiple nodes in my 1 machine ?

Reason i want to have all nodes in 1 machine is because currently I am learning & validating few of it's capabilities.

Note: I referred to this http://middlewaremagic.com/jboss/?p=1952 but, i keep getting the following error

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.network.public: org.jboss.msc.service.StartException in service jboss.network.public: JBAS015810: failed to resolve interface public
    at org.jboss.as.server.services.net.NetworkInterfaceService.start(NetworkInterfaceService.java:96) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]

Updated understanding on Standalone vs Domain: The HA or Failover feature provided by the multiple nodes in a cluster is the same between Standalone or Domain mode. The difference is that, in Domain mode, it allows the admins to manage/deploy all the nodes via a single (domain controler) node's Admin Console. This URL has a good explanation on it

Ref: https://docs.jboss.org/author/display/WFLY8/Admin+Guide#AdminGuide-

Update: As of now for learning purpose, i have configured to run multiple nodes in my machine using Domain mode blog.arungupta.me/wildfly-8-clustering-and-session-failover

yathirigan
  • 5,619
  • 22
  • 66
  • 104
  • Try set `port-offset` for each instance http://planet.jboss.org/post/multiple_instances_of_wildfly_on_different_ports_on_same_machine_tech_tip_8 – Federico Sierra Feb 16 '15 at 16:15

1 Answers1

6

Try to execute two or more instances on the same machine using a HA profile, choose the standalone-ha.xml. For example, on the same machine:

%WILDFLY_HOME_1%/standalone.bat -c standalone-ha.xml -Djboss.node.name=srv1;

and

%WILDFLY_HOME_2%/standalone.bat -c standalone-ha.xml -Djboss.node.name=srv2 -Djboss.socket.binding.port-offset=100

and you'll have a cluster of two nodes on the same machine, the first one bound to port 8080 and the second one bound to port 8180. There is no need configuring a domain to have a cluster.

Francesco
  • 1,742
  • 5
  • 44
  • 78
  • but how do these standalone nodes know that they are the HA pair ? is there any configuration where i should mention the node names of these 2 HA nodes ? i understand that we can use a load balancer in-front of these 2 nodes to split user requests between these 2 nodes but, how is the "Session Clustering" kind of features gets executed between these 2 HA Nodes ? – yathirigan Feb 17 '15 at 16:00
  • Wildfly uses JGroups plus Infinispan to turn instances to cluster's node and share session infos (HTTP Session and Stateful EJB). Communication between nodes use by default a multicast address, take a look at `` at the bottom of the `standalone-ha.xml`, you should find some ` – Francesco Feb 17 '15 at 16:13
  • does this mean that, once i create and run the 2 nodes in my machine, they automatically work like belonging to a single HA Cluser and I don't have to do any configuration for it ? Note: Assuming that I haven't touched the configuration/standalone-ha.xml file in my both "standalone-node1" and "standalone-node2" folders. – yathirigan Feb 17 '15 at 16:29
  • 1
    You should be able to see it in the log. The first node should report that the second one has joined the cluster. Did you try it? – Francesco Feb 17 '15 at 16:47