Mod cluster Concepts

From NovaOrdis Knowledge Base
Revision as of 18:29, 10 October 2016 by Ovidiu (talk | contribs) (→‎Modules)
Jump to navigation Jump to search

Internal

Architecture

mod_cluster general idea is that the httpd process instantiates balancers, which are mechanism capable of sending requests into a set of back end nodes. Each balancer has a set of worker nodes, each worker node corresponding to a back end node. The node population associated with a balancer is dynamic - explain that. Virtual hosts work with balancers: a virtual host has the capability to either send requests into one or more balancers, based, which in turn send the requests into their node population, or serves the request locally from its DocumentRoot. The balancers are dynamically updated with contexts over the network.

Questions:

  • Understand the relationship between manager and a virtual host - do we need a virtual host to wrap around a manager?
  • Is the top level balancer common to all virtual hosts while one declared inside a proxy is private to that proxy? Try to use a balancer declared in VH1 from VH2.
  • Clarify the relationship between balancer and virtual host.
  • Understand how a back end node dynamically updates its own context on the front-end. This makes ProxyPass superfluous.

httpd multicasts itself as soon as it starts. JBoss mod_cluster service listens to proxy advertisements:

21:08:31,156 INFO  [org.jboss.modcluster] (ServerService Thread Pool -- 62) MODCLUSTER000032: Listening to proxy advertisements on /224.0.1.105:23364

Requests flow from httpd to AS nodes, and the AS nodes open feedback channels back to httpd.


Manager

The mod_cluster manager runs inside a virtual host. The manager is available over HTTP at http://<virtual-host-ip-address>:<virtual-host-port>/mod_cluster-manager

Balancer

TODO: what is a "balancer". There's a default one, whose default name is "mycluster". The name of the balancer can be specified by the back-end nodes. What is it? What is its function. Represent it on the diagram.


balancer://<balancer-name> is used in ProxyPass directives.


Places in which a balancer can be configured:

Worker Node

Domain

What is a domain?

Nods might be partitioned into mod-cluster 'domains'. Each domain can run on different versions of EAP / JGroups. Sticky sessions per mod-cluster domain is done by appending the node and domain identity to the jsessionid. Sessions are sticky per domain: so if a node crashes, a node from the same domain is picked. If none is available, then any domain is picked.Via the mod-cluster-manager app, you could de-activate entire domains, which means that new sessions were not created in that domain, but existing sessions would continue to be served. When all sessions of a given domain had timed out, the domain could be shut down (and updated, for example).

Modules

mod_manager

mod_managers, also known as the cluster manager module, manages the communication with the worker nodes. It receives and acknowledges node messages concerning registration, node load data and life cycle events of the application deployed on worker nodes.

mod_manager Configuration


mod_cluster_slotmem

mod_proxy_cluster

mod_proxy_cluster cannot work correctly if mod_proxy's mod_proxy_balancer is loaded, so mod_proxy_balancer must be removed from the httpd configuration.

mod_proxy_cluster Configuration

mod_advertise

mod_advertise multicasts the VirtualHost where is configured. It must be the same VirtualHost where mod_manager is defined.

mod_advertise Configuration

Dependency on mod_proxy

TODO

  • Why are mod_proxy.so and mod_proxy_ajp.so and how are they used?
  • Are there any mod_proxy modules that must be removed?

jboss.node.name

JBoss mod_cluster service uses the "jboss.node.name" system property as identity information when registering with httpd.

Sticky Session

This is how sticky session is configured: mod_cluster Sticky Session Configuration.

Organizatorium

Initialization

Upon the initialization of the mod_cluster service on the JBoss node, it sends the following sequence of requests:

  • INFO /
  • CONFIG /JVMRoute=webr01&Port=8009&Host=192.168.0.147&Type=ajp&StickySessionForce=No&Maxattempts=1
  • At this moment the balancer is created and the corresponding worker is initialized in each existing httpd child process.
  • STATUS /JVMRoute=webr01&Load=-1 - periodic status updates + periodic ajp_cping_cpong initiated by the web server. Not sure at this point who initiates who, and who answers who - they seem to be related.
  • proxy_cluster_watchdog_func (?)

Upon the deployment of a new application, the node sends the following sequence: