Web Farm with multiple sites using a single kentico instance

Tomaso Pye asked on December 2, 2014 20:54

I am intending to host 3 sites with distinct URLs on a 2 server kentico farm (http://www.foo.com, http://www.bar.com and http://www.baz.com), using a single Kentico instance (1 application, 1 db). The web servers are behind a load balancer, passing the host header to the server s it can decide which site gets the traffic.

I can only setup 2 Web Farm Servers, because the web.config can only provide a single server code name. Each Web Farm Server has the limitation of pointing to a single URL as well.

So what is the best way to setup the Web Farm Servers? * Should I leave the Default Website active with an application on it referencing the Kentico8 folder? In that case I would need to setup 2 keys using the machine names (I don't want to use IP addresses), and use those for the farm server URLs * Do I need to split this up into 3 application installations sharing the same database, each with their own set of 2 farm servers pointing at their URLs? This does provide better isolation, but makes upgrade and management a bigger hassle. * Some other option?

Any and all help is appreciated.

Thanks, Tomaso

Recent Answers


Brenden Kehren answered on December 2, 2014 21:30

When setting the web.config keys, you can use generic names like Server1 or Server2. When you configure the UI for web farm servers, you will reference those code names you entered in your web.config keys using IP addresses to access the servers internally. Kentico's documentation states this specifically. You'll also have to create license keys and site aliases for these IP addresses as well. I say site aliases from experience as sometimes the scheduled tasks error out because there isn't an IP alias.

I choose and prefer to not automatically generate the web farm servers automatically because I've had not good luck with it. It works but I've had unexpected results.

Your load balancer should handle all the redirecting of domain names to the servers. Then in your Kentico instance you will need to add all the license keys as well as domains and aliases for each each site. Kentico will then know which site to serve up based on the domain being requested from the load balancer.

Depending on the sites, 3 different instances of Kentico will work but you'll then have 3 different instances of Kentico to upgrade when that time comes. Kentico was made to run several sites on a single instance so I'd stick with that option.

0 votesVote for this answer Mark as a Correct answer

Tomaso Pye answered on December 2, 2014 21:50

Hi Brenden, thanks for your response.

I do not see anywhere in the documentation that explicitly states that you must use the IP addresses of the farm servers. It just appears to be the example.

I appreciate your tip about adding the farm server URLs as Domain aliases for the site, but Kentico does not allow for 2 sites to share the exact same domain alias.

If there are problems farm servers not working without their URLs being domain aliases, this seems to indicate that I must have 1 copy of the application files per IIS Website, and 2 farm servers per kentico site.

In some ways this does make it easier, but upgrade will be painful.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 3, 2014 00:47

My apologies, when I looked at the documentation it showed IP addresses for the internal server URLs. You may be able to get away with http://servername internally or inside a DMZ that has the server name exposed, although in my testing and site setups, I haven't been able to. **note they were all v7 instances within a DMZ, v8 may be different as well as an intranet site.

You stated you would have three different sites so why would you want to have an alias for different domains? If you're talking about adding them for the scheduled, tasks, that should only need to be added to one site so it is at least accessible. I'm not stating they won't work, I'm stating in my experience I was able to eliminate errors/issues with a web farm environment by adding the aliases. It could have very well been the environments I was working in were not setup right from the load balancer but I know what worked in several instances and what didn't.

As I mentioned you can have multiple websites on a single instance of Kentico within a web farm environment. It does make it easier to have the sites separated and setup, although maintenance is and will continue to be a huge nightmare. You'll find yourself making the same changes across 3 instances multiple times not to mention the hotfixes/upgrades you've already mentioned. Also you won't get the benefit of sharing any of the work you've done in one site with another site (shared layouts, webparts, templates, etc.)

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.