Reputation: 2485
we need from time to time to perform some maintainence on nodes of our WildFly cluster nodes. During these operations we want that the node leaves the cluster but it's still possible to manage its configuration through the CLI or the Web console.
Later on, the member should return to the cluster.
Any suggestion how to do that, without a server restart ?
Thanks
Upvotes: 3
Views: 2341
Reputation: 4328
I think this kind of scenario is worth exploring especially in standalone mode where every server of the cluster can have an individual configuration, hence you might need some maintenance at server level. That being said, you can use the multicast address to switch off a Server or a Server Group from the Cluster and later, once that you completed the maintenance, let it return to the cluster.
1. Start by finding a multicast address which is not being used in your network.
2. Next, create a new Socket Binding group which has a custom jgroups-udp IP address (or jgroups-tcp if you are using a TCP cluster):
<socket-binding-group name="ha-sockets.maintenance" default-interface="public">
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
<socket-binding name="jgroups-tcp" port="7600"/>
<socket-binding name="jgroups-tcp-fd" port="57600"/>
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.11}" multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd" port="54200"/>
<socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
Now, when you need to temporarily remove a Server Group from the cluster, just issue from your CLI (you can use as well the Admin Console):
/server-group=other-server-group/:write-attribute(name=socket-binding-group,value=ha-sockets.maintenance)
You will also need an host reload after the above operation:
reload --host=master
Now, the other server group will leave the cluster so you can perform maintenance. Later on, you can let your Server Group join the cluster, by setting the standard ha-sockets bindings:
/server-group=other-server-group/:write-attribute(name=socket-binding-group,value=ha-sockets)
As a side node, consider that you can even set the socket bindings at server level with:
/host=master/server-config=server-one/:write-attribute(name=socket-binding-group,value=ha-sockets.maintenance)
I don't advice it though as you will have an unsynchronized configuration between your servers which are part of a Server group. Hope it helps. For further information check this tutorial
Upvotes: 3