AppFabric is a set of integrated technologies that help build, scale and manage Web and composite applications that run on IIS. AppFabric manages and hosts Windows Communication Foundation, Windows Workflow and offers a session state provider for ASP.NET Web Applications as part of its caching features.
It provides capabilities to build and manage composite applications, including:
- Enhanced design and development tools in Visual Studio to build rich composite applications
- Management and monitoring of services and workflows via integration with IIS Manager and Windows PowerShell
- Distributed in-memory application cache to improve application performance
As this quite a lengthy topic, this post is split into the following sections:
- Windows Server AppFabric Setup
- Installing Windows Server AppFabric Software Requirements
- Microsoft Windows OS
- IIS 7.0
- IIS 7.0 Administration Pack
- .NET Framework 4.0
- Windows PowerShell v2.0
- SQL Server 2008
- Visual Studio 2010
- IIS Web Deployment Tool 2.0
- Required Hotfixes for AppFabric
- Installing Windows Server AppFabric
- Runtime Features
- Administration Tools
- Configuring Windows Server AppFabric
- Configure Hosting Services
- Windows Server AppFabric Monitoring Store Configuration
- Windows Server AppFabric Persistence Store Configuration
- Configure Caching Services
- Windows Server AppFabric Caching Service configuration Store
- Configure AppFabric Cache Node
- Start Cache Host Service
- Verifying Installation of Windows Server AppFabric
Windows Server AppFabric Setup
AppFabric offers a multi-server topology which can be scaled out as required. I will cover scaling out AppFabric on a Server Farm (both Application and Database tiers) in a separate post.
For this installation I will demonstrate installing and configuring AppFabric on a simple single node application server and separate database server.
There are different downloads for Windows Server AppFabric that is specific to your operating system. The links below are direct downloads.
In active directory create two security groups:
- [DOMAIN]\AFabric Administrators
- [DOMAIN]\AFabric Users
Installing Windows Server AppFabric Software Requirements
As with most installations, the servers must first be prepared. Base software requirements are:
- Windows OS
- IIS 7.0
- IIS 7.0 Administration Pack
- .NET Framework 4.0
- Windows PowerShell v2.0
- SQL Server 2008
- IIS Web Deployment Tool 1.0
- Visual Studio 2010
- Required Hotfixes for AppFabric
Microsoft Windows OS
AppFabric can be installed on the following operating systems:
- Microsoft Windows Server 2008 R2
- Microsoft Windows Server 2008 (32-bit or 64-bit) with Service Pack 2
- Microsoft Windows 7 (32-bit or 64-bit)
- Microsoft Windows Vista (32-bit or 64-bit) with Service Pack 2
The following roles needs to be enabled in Windows Server 2008 / R2:
- Application Server
- Web Server (IIS)
The roles need to be installed:
- .NET Framework 3.5.1
- WCF Activation
- HTTP Activation
- Non-HTTP Activation
- Remote Server Administration Tools
- Roll Administration Tools
- Windows PowerShell Integrated Scripting Environment (ISE)
- Windows Process Activation Service
- Process Model
- .NET Environment
- Configuration APIs
IIS 7.0
IIS 7.0 enables Windows Application Server to host ASP.NET Web sites and Web services that communicate over Http, including WCF Services over other protocols such as Http and net.tcp.
IIS 7.0 is a role that needs to be enabled in Windows Server 2008
IIS 7.0 Administration Pack
IIS 7.0 Administration Pack adds management features that ship with IIS 7.0.
- Administration UI support for ASP.NET authorization
- Custom errors
- FastCGI configuration
- Request Filtering
- Generic configuration editor
The generic configuration editor configures IIS 7.0 configuration and automatically generates scripts to make a tasks easily repeatable.
IIS 7.0 Administration Pack is not required for Windows 7 and Windows Server 2008 R2.
.NET Framework 4.0
.NET Framework 4.0 (at the time of writing and exception of .NET Framework 4.5 preview) is latest managed code programming model for Windows. .NET Framework 4.0 enables AppFabric to extend IIS to be a ‘standard host’ for applications that use either WF or WCF.
.NET Framework 4 can be downloaded and installed as either and web and standalone installation
Windows PowerShell v2.0
Windows PowerShell 2.0 provides a consolidated management interface in which AppFabric cmdlets perform application, database, and system service management operations. Functionality in AppFabric cmdlets can be accessed in three ways:
- UI
- Interactively through the command-line shell console
- Creating and running scripts that contain one or more of AppFabric cmdlets.
Windows PowerShell 2.0 needs to be installed on Windows Server 2008 and Windows Vista only. It is already installed on Windows Server 2008 R2 and Windows 7.
SQL Server 2008
AppFabric Persistence, Monitoring and Configuration runtime databases can be installed on either Microsoft SQL Server or
SQL Server Express.
Visual Studio 2010
(For development purposes only and should not to be installed on UAT/Production servers!)
Visual Studio 2010 includes application templates for WF and WCF which support .NET Framework 4.0 features used in AppFabric. For WF features include:
- Base Activity Library
- Flowchart Activity Designer
For WCF features include
- System Endpoints
- WS-Discovery
- Workflow Services
IIS Web Deployment Tool 2.0
IIS Web Deployment Tool 2.0 (or MSDeploy) is used to deploy IIS Web application and services to a Web Server farm. Web Deployment Tool can be administered both command-line and Windows PowerShell interface.
Web Deployment Tool will copy or synchronize an application from one virtual directory or Web site to all IIS Web servers in that IIS Web farm.
IIS Web Deployment Tool 2.0 can be download from
http://www.iis.net/extensions/WebDeploymentTool. Start the installation and select ‘Next’.
Read and accept the licence agreement. Select ‘Next’ to continue.
Select ‘Custom’ to continue.
On the Custom Setup window, select all features except Authorization and Error Pages under the ASP.Net Features. Select Next and then Install.
Once IIS Web Deployment Tool is installed click Finish to exit.
Required Hotfixes for AppFabric
For Windows Server AppFabric there are two recommended updates. See
http://msdn.microsoft.com/en-us/windowsserver/ff637504 the list of hotfixes to install.
Issue | Resolution |
You experience several issues when you use Powershell cmdlets or AppFabric features in IIS 7.0 or IIS 7.5
http://support.microsoft.com/kb/980423 | KB980423 |
Some services are preloaded unexpectedly when you start a website that contains multiple applications in IIS 7.5
http://support.microsoft.com/kb/983484 | KB983484 |
Installing Windows Server AppFabric
Download the correct version of Windows Server AppFabric for your operating system and launch setup.
In the Windows Server AppFabric Wizard read and accept the licence agreement and click Next.
On the Customer Experience Improvement Program page, select to want to participate in the program to help Microsoft improve Windows Server AppFabric, and then click Next.
Information of issues and setup is periodically sent to Microsoft – no personal or identifiable information is sent.
In the Feature Selection screen select all runtime features and administration tools.
Runtime Features
- Hosting Services - component installs AppFabric host and management services
- Caching Services - component turns a server host into the node of a distributed cache cluster. A new cluster can be created or this host can be joined to an existing cluster of AppFabric Caching Services.
- Cache Client - component installs client libraries enabling use of cache functionality in applications during development or runtime.
Administration Tools
- Hosting Administration - component installs IIS Manager, AppFabric configuration wizard, and hosting features PowerShell modules enabling to administration of Hosting Services.
- Distributed Cache Admin - component installs the components
that enable administrating a cache cluster.
Click Next to continue.
Review the list of the features that were selected in the Feature Selection page. Select Install to begin installation.
Verify that the installation succeeded. Check ‘Launch configuration wizard’ and Finish to complete AppFabric installation and launch the configuration wizard.
Configuring Windows Server AppFabric
The configuration can be re-run at anytime. An important point to note, the configuration wizard overwrites existing configuration values with any new values that entered in the wizard. Many of the steps that are performed in the configuration wizard can be performed manually by executing AppFabric configuration cmdlets.
Select Yes to participate in the Customer Experience Improvement program and click next to to continue.
Configure Hosting Services
Configure Hosting services page configures AppFabric monitoring and persistence services.
The Event Collector service account is a member of Administrators group and has administrative access to the Monitoring database. Event Collector service account by default is set to NT Authority\LocalService. This can be changed to a another account.
All valid Monitoring data providers registered on the local machine.config file will be displayed in the Monitoring providers list. Click Configure… to specify settings to initialize and register an AppFabric monitoring store with the Microsoft SQL Server Monitoring Provider.
Windows Server AppFabric Monitoring Store Configuration
On the Windows Server AppFabric Monitoring Store Configuration dialog select the ‘Register AppFabric monitoring store in root web.config’ check box. This registers the monitoring store by adding its configuration to the root web.config file as ApplicationServerMonitoringConnectionString. This registration makes the connection string and behaviour available at all services on the computer.
Next check ‘Initialize the Monitoring Store’. This initializes the monitoring database identified in the connection string. Initialization creates the database schema and the structure based upon that schema. If the database does not exist, it will be created and then initialized.
On the Security Configuration section change the values for Administrators, Readers and Writers as follows:
Role | Change Security Group To: |
Administrators | [DOMAIN]\AFabric Adminstrators |
Readers | [DOMAIN]\AFabric Users |
Writers | [DOMAIN]\AFabric Adminstrators |
Select OK to apply changes to AppFabric monitoring store configuration.
In the confirmation dialog select ‘Yes’.
Once the monitoring store configuration the registered and initialised, you will be prompted with the following dialog. Click OK.
Next, check ‘Set persistence configuration’ and select ‘Configure…’. This will initialize and register an AppFabric persistence store with SQL Server Persistence Provider.
Windows Server AppFabric Persistence Store Configuration
The Windows Server AppFabric Persistence Store Configuration dialog initializes and registers an AppFabric persistence store. Check ‘Register AppFabric persistence store in root web.config’ to add ApplicationServerWorkflowInstanceStoreConnectionString to the root web.config.
Check ‘Initialise persistence store’, enter the database server name and type or select the database store. This step initializes and creates the database schema. If the database does not exist, the database is first created and then initialized.
On the Security Configuration section change the values for Administrators, Readers and Users as follows:
Role | Change Security Group To: |
Administrators | [DOMAIN]\AFabric Adminstrators |
Readers | [DOMAIN]\AFabric Users |
Users | [BUILTIN]\IIS_USRS |
Select OK to apply changes to AppFabric persistence store configuration.
Select OK to confirm the configuration.
Select ‘Next’ to continue.
Configure Caching Services
Configure Caching Service page updates system-level configuration of the Caching Service feature.
The Caching Service configuration provider has two configuration options:
- XML - configuration information is stored in an XML file on a network file share. In this option you need to enter enter or browse to the network file share that will contain the XML configuration file.
- SQL Server AppFabric Caching Service Configuration - configuration information is stored in a SQL Server database.
In this post we configure the Caching Services to use SQL Server AppFabric Caching Service Configuration.
Check ‘Set Caching Service Configuration’, select Caching Service configuration provider as ‘SQL Server AppFabric Caching Service Configuration Store Provider’ and select ‘Configure…’.
Windows Server AppFabric Caching Service configuration Store
In the Windows Server AppFabric Caching Service configuration Store dialog check ‘Register AppFabric Caching Service configuration database’. This registers the configuration database in the to the root web.config file.
Next check ‘Create AppFabric Caching Service configuration database’. Enter the database server and either select or enter and database name.
Select OK to apply the configuration.
The Caching Service configuration database is now created and registered
successfully.
As this is the first caching service server in the cluster select ‘New Cluster’ option and select the appropriate cluster size. Select Next to continue.
Configure AppFabric Cache Node
On the Configure AppFabric Cache Node page enter port numbers for:
- Cache port (default 22233)
- Cluster port (22234)
- Arbitration port (22235)
- Replication port (22236)
The port numbers must be unique and be between 1024 and 65535.
For each port number ensure Windows Firewall rules are configured to allow access for the cache service. Check both options ‘Windows Server AppFabric Caching Service’ and ‘Remote Service Management’.
Select Yes to apply selected configuration. And finish to close Windows Server AppFabric Configuration Wizard.
Start Cache Host Service
The cache cluster needs to be started after AppFabric configuration wizard has configured the Caching Service. This is started user PowerShell. On the primary node of Cache Host cluster open the PowerShell command window.
Execute the following cmdlets:
- Import-Module DistributedCacheAdministration
- Import-Module DistributedCacheConfiguration
- Use-CacheCluster
- Start-CacheCluster
Verifying Installation of Windows Server AppFabric
After AppFabric is installed and configured, AppFabric IIS Manager extensions will be visible under IIS.
AppFabric Dashboard (which very similar to BizTalk 2010 group hub).
Features view of endpoints configured under AppFabric.
Features view of Services hosted under AppFabric.
The following AppFabric Monitoring and persistence runtime databases will have been created in SQL Server:
- AppFabricCachingServiceConfigDb
- AppFabricMonitoringStoreDb
- AppFabricPersistenceStoreDb
Under services AppFabric will have installed the following services:
- AppFabric Caching Service
- AppFabric Event Collection Service
- AppFabric Workflow Management Service
In this blog post I have demonstrated how to install and configure Windows Server AppFabric Hosting and Caching Services. In future blog posts I will show how to develop Workflows and WCF services, demonstrating how to deploy, configure and monitoring them under AppFabric.