Book Image

Microsoft Windows Server AppFabric Cookbook

Book Image

Microsoft Windows Server AppFabric Cookbook

Overview of this book

Windows Server AppFabric provides a set of integrated capabilities that extend IIS and the Windows Server platform making it easier to build, scale and manage composite applications today. Windows Server AppFabric delivers the first wave of innovation within an exciting new middleware paradigm which brings performance, scalability and enhanced management capabilities to the platform for applications built on the .NET Framework using Windows Communication Foundation and Windows Workflow Foundation.'Microsoft Windows Server AppFabric Cookbook' shows you how to get the most from WCF and WF services using Windows Server AppFabric leveraging the capabilities for building composite solutions on the .NET platform. Packed with over 60 task-based and immediately reusable recipes, 'Microsoft Windows Server AppFabric Cookbook' starts by showing you how to set up your development environment to start using Windows Server AppFabric quickly. The book then moves on to provide comprehensive coverage of the most important capabilities provided by Windows Server AppFabric, diving right in to hands-on topics such as deploying WCF and WF applications to Windows Server AppFabric and leveraging the distributed caching, scalable hosting, persistence, monitoring and management capabilities that Windows Server AppFabric has to offer, with recipes covering a full spectrum of complexity from simple to intermediate and advanced.
Table of Contents (16 chapters)
Microsoft Windows Server AppFabric Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Configuring Windows Server AppFabric (caching)


Once you have finished configuring the Hosting Services as discussed in the preceding recipe, the next task is to configure the Caching Services for AppFabric. Just like in the preceding recipe, we will select a service account that should be part of the administrator group so that it has an administrative access to the caching configuration provider. Once again we will consider a workstation configuration and select a valid local system account.

We will see how to setup the Caching Configuration Store Provider. At the end of this recipe, we will also see how to join/create a new cache cluster (that this, the instance of Window Server AppFabric Cache is part of) along with the end point details (that is, port addresses) used by AppFabric services to communicate on the network.

Once we have configured Windows Server AppFabric Caching Services, we will be able to start using AppFabric Caching.

Getting ready

To begin this recipe, we will need the following in place:

  • A service account for the AppFabric Caching service.

  • A file share (UNC Server Share) to store XML based cache configurations or a SQL Server database for a SQL Server based AppFabric Configuration store. (This is required for configuring a High Availability Caching Service scenario that runs on Windows Server 2008.)

How to do it...

To set up Windows Server AppFabric Caching follow these steps:

  1. 1. Run the AppFabric Configuration wizard.

  2. 2. Accept the User Account Control (UAC) dialog, confirming that you will allow this program to make changes to your computer.

  3. 3. Click on Next on the Before you Begin and Configure Hosting Services screens to reach Configure Caching Service.

    Note

    You cannot directly select Caching Service Configuration from the left-hand navigation panel on the Windows Server AppFabric Configuration Wizard.

  4. 4. Once you are on the Caching Service screen of the Configure AppFabric wizard, select the Set Caching Service configuration.

  5. 5. Under Caching Service Account, click on Change. This will allow you to select the identity for the Caching Service Account.

  6. 6. If your machine is in workstation mode, then you cannot change the service account. Otherwise, you can browse and select a local account (that has administrative access to the Caching Configuration store).

  7. 7. Select XML from the Caching Service configuration provider dropdown.

  8. 8. The SQL Server based configuration is not available for the Caching Configuration Service in workstation mode. If you select SQL provider and click on Configure, you will get the following error message:

    Note

    We discuss the use of SQL Server AppFabric Caching Service Configuration Store Provider in more detail in Chapter 7, Monitoring Windows Server AppFabric Deployment.

  9. 9. Under File Share, provide a file path of an existing UNC file share. This will allow Windows Server AppFabric's Configuration Service to store and manage information stored as an XML file under this provided path. Your screen will appear as follows:

  10. 10. It should be noted that the File share (UNC server share) selection wizard will not allow you to create a new file share. As highlighted in the beginning of the recipe, it is required to have a UNC file share readily available. Under cluster information select New Cluster and click on Next.

  11. 11. Configure AppFabric Cache Node by providing a unique port number value (numbers must be between 1024 and 65535) for the Cache port, Cluster port, Arbitration port, and Replication port.

    Note

    The Cache port is used for transmitting data between Cache Clients and Cache Hosts. The Cluster port enables Cache Cluster formation and Management. The Arbitration port is used to double check if the Cache Host is unavailable. Arbitration is used when the Cache Host fails. The Replication Host is used to move data between the Cache Hosts. Replication is used when Cache is configured for High Availability.

  12. 12. Configure Windows firewall exceptions by selecting the rules for Windows Server AppFabric Caching Service and Remote Service Management. Your screen should appear similar to the following:

    Note

    If you are using any third-party (non-Microsoft) firewall then you will need to manually update the firewall rules. This must be done to allow Windows Server AppFabric to use the ports that were specified during its configuration.

  13. 13. After clicking on Next, click on Yes on the Windows Server AppFabric Configuration Wizard dialog box and you will come to the end of the wizard with an option to launch IIS to further manage Windows Server AppFabric. Click on Finish to close the wizard.

  14. 14. Congratulations! You have fully configured Windows Server AppFabric. Click on Finish.

Note

The High Availability feature of Windows Server AppFabric Caching can only be enabled on Enterprise versions of Windows Server 2008/2008 R2. This implies that all the nodes in the cluster must have enterprise editions of Windows Server 2008/2008 R2. For more information you may refer to: http://go.microsoft.com/fwlink/?LinkId=164929.

How it works...

The Windows Server AppFabric Caching Service requires a service account to run its Windows service as well as a configuration provider where it can store its configuration. As the caching service runs under the identity of the provided account, the account must have administrative privileges so that it can access and modify the configuration.

The Windows Server AppFabric Caching Service needs to identify which ports to connect to in order to communicate with the other hosts in the cluster. Once the port numbers are specified, ensure that any software or hardware firewalls are not blocking these ports.

As we experienced in this recipe, the Windows Server AppFabric Caching Service is highly configurable and the configuration wizard makes it extremely easy to set up (or change) the existing configuration.

Now that we have configured Services for AppFabric and all the services are up and running under valid service accounts along with firewall rule definitions, we can now start coding to test and start consuming the caching service.