1

I am currently using the default HA configuration in Wildfly 11. I would like to know how can I tell which particular cluster is preferred if it is available.

I believe I should change the singleton subsystem but I do not know how.

<subsystem xmlns="urn:jboss:domain:singleton:1.0">
    <singleton-policies default="default">
        <singleton-policy name="default" cache-container="server">
            <simple-election-policy/>
        </singleton-policy>
    </singleton-policies>
</subsystem>

EDIT

Run ./jboss-cli

Run the command: /subsystem=singleton/singleton-policy=default/election-policy=simple:write-attribute(name=name-preferences,value=[node3,node2,node1])

The standalone-ha.xml was altered to:

<subsystem xmlns="urn:jboss:domain:singleton:1.0">
    <singleton-policies default="default">
        <singleton-policy name="default" cache-container="server">
            <simple-election-policy>
                <name-preferences>node3 node2 node1</name-preferences>
            </simple-election-policy>
        </singleton-policy>
    </singleton-policies>
</subsystem>

Now I'd like to know what is the name to put in place of node3, node2, node1.

How to define the name from my node?

Luciano Borges
  • 817
  • 3
  • 12
  • 31

1 Answers1

0

Step 1: Edit the standalone-ha.xml from the master server and enter a name attribute in the tag below:

<server name="master" xmlns="urn:jboss:domain:5.0">

Step 2: Edit the standalone-ha.xml from the slave server and enter a name attribute in the tag below:

<server name="slave" xmlns="urn:jboss:domain:5.0">

Step 3: Edit the subsystem singleton in both servers like below:

<subsystem xmlns="urn:jboss:domain:singleton:1.0">
    <singleton-policies default="default">
        <singleton-policy name="default" cache-container="server">
            <simple-election-policy>
                <name-preferences>master</name-preferences>
            </simple-election-policy>
        </singleton-policy>
    </singleton-policies>
</subsystem>

When the master drops then the slave takes over, but when the master get up it reassume the command.

Luciano Borges
  • 817
  • 3
  • 12
  • 31