0

I have recently found out that mod_cluster offers more capabilities than mod_proxy or similiar modules. Hence there are dynamic deployment and new metrics available for the load balancing I have a question if there is a possibility to write own load balancing algorithm instead of using predefined ones. If so where to implement it?

Tomek
  • 3
  • 2

1 Answers1

0

Yes its possible. You need following steps:

  1. Create custom load metric by extending AbstractLoadMetric
  2. Package the custom load metric as a JAR
  3. Copy JAR to modcluster module
  4. Update module.xml to include the custom load metric JAR
  5. Update standalone/domain config XML to use custom load metric

See sample example here: https://github.com/Karm/mod_cluster-custom-load-metric

NOTE: WildFly 9 will bring improvement in this mechanism to avoid editing of module.xml. See https://issues.jboss.org/browse/WFLY-372

Aparna Chaudhary
  • 1,325
  • 8
  • 10
  • Thank you for your answear, it's very helpful. As I understand I should repeat this steps on each node of the cluster setting its capacity, history and weight properties to customize load distribution? – Tomek Apr 01 '15 at 13:27
  • Yes, if you are using standalone mode. If you are using domain mode, then step 5 is only required to be done once to update domain.xml for the relevant profile(s). – Aparna Chaudhary Apr 01 '15 at 17:42