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

Changing the Windows Server AppFabric configuration after installation


Once Windows Server AppFabric is configured, it is still possible to change its configuration.

There could be a number of reasons for changing the configuration of an existing deployment. The following are some of the most common scenarios that would require such changes:

  • Changes database repository (SQL instance for example)

  • Changes to system accounts (for security reasons)

  • Port number related changes for caching.

You can use the Windows Server AppFabric configuration wizard and make the required changes as they are required. In this recipe, we will see how to re-configure Windows Server AppFabric after installation.

Getting ready

You will need an existing instance of AppFabric that has been installed and configured to get started with this recipe. In this recipe, we will learn how to change Windows Server AppFabric configuration after it has been installed on the host OS.

How to do it...

To begin, launch the AppFabric Configuration wizard to go through the configuration options on an existing installation of AppFabric to easily select the options that we want to change.

  1. 1. Start the Window Server AppFabric Configuration wizard.

  2. 2. Accept the User Account Control (UAC) warning. Click on Next at the bottom of the screen to get started with the configuration.

  3. 3. Give the wizard a few seconds while it loads the existing configuration. The screen should look as follows:

    Note

    Once the configuration is loaded, you will notice that the green tick under the monitoring and persistence configurations states that the default monitoring store is registered.

  4. 4. We can now go ahead and change the monitoring configuration by selecting Set monitoring configuration and clicking on Change.

  5. 5. This will launch a Windows Server AppFabric Monitoring Store Configuration wizard that we have already used in the recipe Configuring Windows Server AppFabric (hosting and monitoring) earlier in this chapter.

  6. 6. By selecting Register AppFabric monitoring store in root web.config, we can specify the Server and Database name.

    Note

    Registering the monitoring or persistence store in the configuration implies that that the connection string (with the name = ApplicationServerMonitoringConnectionString) is placed in the root Web.Config file and is made available to all subsequent websites.

    Note

    The Initialize monitoring store option will create a new database (if it does not already exist) and it will also initialize the schema and the structure of the database (based on the Microsoft SQL Server provider for the AppFabric monitoring site).

    It should also be noted that if you skip the Register AppFabric monitoring store in root web.config option, then the monitoring database will not be available on this computer.

  7. 7. We can repeat steps 4, 5, and 6 by selecting Set persistence configuration.

  8. 8. Next move to Caching Service and select Set Caching Service configuration, as shown in the following screenshot:

  9. 9. Change the Caching Service account by selecting Change and opting for a relevant account.

  10. 10. Change the File share (UNC server share) by browsing and selecting the appropriate share that we want to store the XML configuration file.

  11. 11. Join an existing cluster (as opposed to creating a new one) by selecting the Join cluster option, as shown in the following screenshot:

    Note

    If the configuration already exists, then this caching service instance will become part of an existing cluster.

  12. 12. If you are joining an existing cluster, you will not be able to change the cluster size.

    Note

    It should be noted that the cluster size does not dictate the possible number of machines in the cluster; however, it does optimize the whole cluster based on the size selected. So for example, you can add seven machines to a cluster that is defined as "Small" (1-5 machines). However, Windows Server AppFabric will optimize the caching configuration based on cluster configuration of 1-5 machines.

  13. 13. To change port numbers for caching, click on Next and change the values as required.

    Note

    In case of changing port numbers you must ensure that firewall level exceptions have already been defined for the newly selected port numbers. Otherwise, Windows Server AppFabric Cache will not be able to function properly.

How it works...

One of the best things about Windows Server AppFabric is that it is highly configurable. Configuration can be changed in a variety of ways. For example, in this recipe our changes were driven by the Windows Server AppFabric configuration wizard; however, we could have achieved similar results using AppFabric PowerShell commandlets. We will learn more about PowerShell commandlets in the following chapters.

Another possible way to change configuration is to modify the configuration manually. For example, when using the XML provider, we can always go to the file share and modify the ClusterConfig.xml file.

Windows Server AppFabric uses providers to abstract the implementation details of its Cache configuration as well as persistence and monitoring stores. In this recipe we used out of the box providers, but configuration storage and management can be further extended to implement a custom provider.

At runtime, Windows Server AppFabric looks up the registered configuration provider. Based on the provider it then accesses a specific configuration store. The configuration store is then used to fetch relevant information for that provider. For example, with the Caching configuration provider, the configuration store will store information such as port numbers, service accounts, and so on. Similarly, for the persistence and monitoring configuration providers, the configuration store will maintain information relevant to monitoring and persistence stores such as connection strings, for example.