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. Start the Window Server AppFabric Configuration wizard.
  2. Accept the User Account Control (UAC) warning. Click on Next at the bottom of the screen to get started with the configuration.
  3. Give the wizard a few seconds while it loads the existing configuration. The screen should look as follows:
    How to do it...

    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.

    How to do it...
  4. We can now go ahead and change the monitoring configuration by selecting Set monitoring configuration and clicking on Change.
  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. 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.

    How to do it...

    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. We can repeat steps 4, 5, and 6 by selecting Set persistence configuration.
  8. Next move to Caching Service and select Set Caching Service configuration, as shown in the following screenshot:
    How to do it...
  9. Change the Caching Service account by selecting Change and opting for a relevant account.
  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. Join an existing cluster (as opposed to creating a new one) by selecting the Join cluster option, as shown in the following screenshot:
    How to do it...

    Note

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

  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. 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.

How it works...

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.