Skip to end of metadata
Go to start of metadata

This article will help you (practically, step-by-step) in creating a domain controller instance with two EAP 6.4 instances installed with SwitchYard along with a load balancer. It creates two instances of a cluster a master and slave. Fronted by mod_cluster as the load balancer, it demonstrates a sample SwitchYard application from the quickstarts. For this we will need two machines where each will be running its own SwitchYard instance. There are ways to create virtual network adapters and run two instances in the same machine. Some Googling will give you an idea. Assume we have a subnet of 192.168.1. and two network adapters bound to the following ips

For the lazy folks I have included my files as attachment. We will start by setting up the load balancer in the master machine.

  1. You have installed JDK 1.6 or higher.
  2. You already have setup SwitchYard server (with EAP 6.4) on both the machines and tested it to your utmost satisfaction.

Load Balancer

  • Download mod_cluster. I used version 1.3.1.Final with no ssl.
  • Extract the contents in a safe place say /home/user/tools/httpd2.4
  • Copy httpd2.4/conf/default/ to httpd2.4/conf/httpd.conf
  • Edit the contents in sequence as shown below:
    Notice the file path had an underscore.

    Now start the httpd service or daemon. If all went well, then it should start clean with no errors.
    Access the page

    You should see the cluster information like this:

    Shutdown the load balancer.

    SwitchYard instances

    Domain Controller - Master

  • Create Managament users admin and slave under ManagementRealm
  • Edit domain.xml as follows:
  • Edit host.xml as follows:


  • Create Managament user slave under ManagementRealm
  • Edit host.xml


    Start the domain controller:

    domain -b -bmanagement

    Wait for the master to finish starting up. Now start the slave:

    domain -b -bmanagement

    You should see the following output in the master instance

    This proves that the our setup works. Shutdown the instances. Edit domain.xml of master instance.

  • Add "proxy-list" (MCMP) server to mod-cluster-config
    <mod-cluster-config advertise-socket="modcluster" connector="ajp" proxy-list="">
    Notice this points to our load balancer.
    Start the servers one by one.
    Cluster Demo

    Navigate to EAP home quickstarts/switchyard/demos/cluster and build the credit and dealer applications

    cd credit
    mvn install
    cd ../dealer
    mvn install
  • Visit the Management console of the cluster via the domain controllers URL:
  • Click on Runtime and topology should look like this:
  • Click on Manage Deployments, click Add and add the following deployments
  • Your content repository now should look like this:
  • Assign the deployments and activate it to the main-server-group. The main-server-group should look like this and the deployments should be active:
    Testing cluster demo app
  • Now navigate to folder quickstarts/switchyard/demos/cluster/client and modify the test file. Edit the URL to point to the load balancer's ip address and port.
  • Build the application and execute the test client
    mvn install
    mvn exec:java

    You should see the following output

    Was the offer accepted? true

    And in one of the instances of our cluster.

    INFO  [Credit Service] (http-/ Credit Service : Approving credit for John Smith

    Experiment with more requests hitting the load balancer and notice they being distributed among the master and slave instances.
    That brings to the end of this tutorial. You can read further the Reference materials and complicate things using many servers in the cluster and/or server-group. Have fun!

    The path is never easy

    Here are some of the errors that you may encounter.

    Already registered name
    WARN [] (Controller Boot Thread) JBAS010900: Could not connect to remote domain controller at remote:// – 2-$-JBAS010832: There is already a registered host named 'master'
    WARN [] (Controller Boot Thread) JBAS016581: No domain controller discovery options remain.
    ERROR [] (Controller Boot Thread) JBAS010901: Could not connect to master. Aborting. Error was: java.lang.IllegalStateException: JBAS016519: Tried all domain controller discovery option(s) but unable to connect

    You forgot to change the host name in slave's host.xml

    Indirect dependencies missing
    ERROR [] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "switchyard"),
    ("replicated-cache" => "default")
    • failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
      "Services that were unable to start:" => ["jboss.infinispan.switchyard.default"],
      "Services that may be the cause:" => ["jboss.jgroups.stack"]
      INFO [] (Controller Boot Thread) JBAS014774: Service status report
      JBAS014775: New missing/unsatisfied dependencies:
      service jboss.jgroups.stack (missing) dependents: [service, service jboss.infinispan.switchyard.config]

    In this example, you are starting/using servers without jgroups. So you are not using the full-ha profile. Clustering test can be performed only with full-ha profile instances bound to full-ha-scokets.
    By default the domain.xml is configured to start the main-server-group that is configured with full profile and not full-ha and these instances startup by default. See host.xml


    AS7 Clustering
    AS7 Clustering - alternative
    Simple cluster webapp

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.