Monday 24 June 2013

Install and Configure Windows Server AppFabric

Install and Configure Windows Server AppFabric

    

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.
07a Install and Configure AppFabric
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)
07b Install and Configure AppFabric
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
      • Web Server (IIS) Tools
  • Windows PowerShell Integrated Scripting Environment (ISE)
  • Windows Process Activation Service
    • Process Model
    • .NET Environment
    • Configuration APIs
07c Install and Configure AppFabric
07d Install and Configure AppFabric
07e Install and Configure AppFabric
07f Install and Configure AppFabric
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’.
01 IIS7.0 Web Deploy 2.0
Read and accept the licence agreement. Select ‘Next’ to continue.
02 IIS7.0 Web Deploy 2.0
Select ‘Custom’ to continue.
03 IIS7.0 Web Deploy 2.0
On the Custom Setup window, select all features except Authorization and Error Pages under the ASP.Net Features. Select Next and then Install.
04 IIS7.0 Web Deploy 2.0
05 IIS7.0 Web Deploy 2.0
Once IIS Web Deployment Tool is installed click Finish to exit.
06 IIS7.0 Web Deploy 2.0
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.
IssueResolution
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.
07 Install and Configure AppFabric
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.
08 Install and Configure AppFabric
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.
09 Install and Configure AppFabric
Review the list of the features that were selected in the Feature Selection page. Select Install to begin installation.
10 Install and Configure AppFabric
11 Install and Configure AppFabric
Verify that the installation succeeded. Check ‘Launch configuration wizard’ and Finish to complete AppFabric installation and launch the configuration wizard.
12 Install and Configure AppFabric
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.
13 Install and Configure AppFabric
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.
14 Install and Configure AppFabric
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:
RoleChange 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.
15 Install and Configure AppFabric
In the confirmation dialog select ‘Yes’.
16 Install and Configure AppFabric
Once the monitoring store configuration the registered and initialised, you will be prompted with the following dialog. Click OK.
17 Install and Configure AppFabric
Next, check ‘Set persistence configuration’ and select ‘Configure…’. This will initialize and register an AppFabric persistence store with SQL Server Persistence Provider.
18 Install and Configure AppFabric
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:
RoleChange 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.
19 Install and Configure AppFabric
Select OK to confirm the configuration.
20 Install and Configure AppFabric
Select ‘Next’ to continue.
21 Install and Configure AppFabric
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…’.
22 Install and Configure AppFabric
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.
23 Install and Configure AppFabric
Select OK to apply the configuration.
24 Install and Configure AppFabric
The Caching Service configuration database is now created and registered
successfully.
25 Install and Configure AppFabric
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’.
26 Install and Configure AppFabric
Select Yes to apply selected configuration. And finish to close Windows Server AppFabric Configuration Wizard.
27 Install and Configure AppFabric
28 Install and Configure AppFabric
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:
  1. Import-Module DistributedCacheAdministration
  2. Import-Module DistributedCacheConfiguration
  3. Use-CacheCluster
  4. Start-CacheCluster
28a Install and Configure AppFabric
Verifying Installation of Windows Server AppFabric
After AppFabric is installed and configured, AppFabric IIS Manager extensions will be visible under IIS.
29 Install and Configure AppFabric
AppFabric Dashboard (which very similar to BizTalk 2010 group hub).
30 Install and Configure AppFabric
Features view of endpoints configured under AppFabric.
31 Install and Configure AppFabric
Features view of Services hosted under AppFabric.
32 Install and Configure AppFabric
The following AppFabric Monitoring and persistence runtime databases will have been created in SQL Server:
  • AppFabricCachingServiceConfigDb
  • AppFabricMonitoringStoreDb
  • AppFabricPersistenceStoreDb
33 Install and Configure AppFabric
Under services AppFabric will have installed the following services:
  • AppFabric Caching Service
  • AppFabric Event Collection Service
  • AppFabric Workflow Management Service
34 Install and Configure AppFabric
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.



 

7 comments:

  1. thanks mohan for a wonderful blog in detailed with screen shot, finally I installed and configured for App Fabric

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Server buddies provides Quality remote server management including troubleshooting, Server Management, Plesk Support, Server Maintenance, Server Monitoring, Server Troubleshooting and support for a large variety of customers at affordable rates. Here are option for Server Management, Server Maintenance, Server Monitoring, Server Troubleshooting, Server Optimization, Plesk Support, Linux Support, cPanel Support and Plesk Support.
    .........

    ReplyDelete
  5. Very Useful article, Thank you very much Mohan

    ReplyDelete
  6. Very useful article, and i am very thankful for that tutorial

    ReplyDelete
  7. Useful info, but no images ....

    ReplyDelete