Setting up routing

For HTTP requests to MI Service Layer, the load balancer is free to distribute load to any MI host in the cluster, but requests to MI Viewer and MI Data Flow need special configuration.

MI Viewer

MI Viewer stores some user session state in process, meaning that although a separate instance of MI Viewer is installed on each MI host, requests from a particular user need to be routed to the same instance for the duration of their session. This feature is often called 'client affinity'.

You need to identify MI Viewer requests to the load balancer and set client affinity on those requests. For example, if your load balancer uses path-based routing and regex matches, you can identify MI Viewer requests using the following regex:

^(?:mi(?:$|[\/\?]).*) 

MI Data Flow

This application is not yet ready for high availability. As such, it should be installed on a single MI host. The load balancer should be configured to route requests to this application to the MI host on which it is installed.

Assuming that your load balancer is using path-based routing (deciding how to handle client request based upon the request’s URL), you must configure your load balancer to route requests as follows:

Incoming request Routed to
https://lb-host/mi_dataflow/xxx https://mi-host/mi_dataflow/xxx

where lb-host is the host name of the load balancer and mi-host is the host name of the MI host on which MI Data Flow is installed.

Many load balancers use a regular expression (regex) match to determine where requests are routed to, and what URL path to pass on to the back-end request. For example, if you were using Microsoft ARR as your load balancer, you could achieve the desired routing by defining a new "server farm" comprising the single MI host, and using the following regex match

^(?:(?:mi_dataflow)(?:$|[\/\?]).*) 

This regex pattern is designed to match URLs that start with mi_dataflow, followed by either the end of the string ($) or a forward slash (/) or question mark (?), and then followed by any characters (.*).

In ARR, the entire path of the incoming request is passed on to the server request by specifying the path of /{R:0} (use the first group in the regex).

Service Layer Requests

MI Service Layer requests require no special routing to specific MI hosts or client affinity.