Step

Description

Screenshot

ARR

Install Application Request Routing for IIS.


Server Farm

Define a server farm and add your servers to the farm.


URL Rule 1

Edit the Inbound Rule


URL Rule 2

Edit the Inbound Rule "sticky session"

  • Condition: Match "Token" in HTTP header
  • Server Variable "LB_TOKEN" set to token value
  • Action: Route to Farm

See also MSDN Documentation

Server Affinity

Disable Server Affinity because, we're using a custom

"sticky session" rule (as defined above).


Load Balancing

Set the algorithm to "Server variable hash".

Use "LB_TOKEN" variable, which contains the sessions token.

Same host aliases

For multiple TI services on the same host, aliases must be defined in the Windows hosts file, so they can be referenced in ARR.


Windows hosts file: c:\windows\system32\drivers\etc\hosts 

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
 
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 lh1
127.0.0.1 lh2


Redis

Single Redis instance used by all TIService instances


LB Health check

Health check to TIService.

use /<SiteName>/tisapi/v1.0/global/health which returns http-204 if okay


Limitations

Topic

Description


Cron jobs

Instances of TIService execute cron jobs independently.

Here is the procedure we suggest to ensure that the cron job is executed only by one instance.

  • Change the TIServiceWindowsService.exe.config on both instances by inserting System.Environment to entry CCXAllowedInstanceTypes.
  • In the TIS project create a data node with an formula operator reading out the server name on which the instance is running (System.Environment.MachineName).
  • Force an error in that data node on one machine, e.g. ((string)null).Length.
  • Create a solution runner script recalculating that node and using the action BreakNoData to terminate the execution if it takes place on the wrong machine.
  • Use the solution runner script within your cron job defintions.

See also Setting up a cron job