Share via


Set the Cluster Management Role and Lead Host Designations (AppFabric 1.1)

Microsoft AppFabric 1.1 for Windows Server offers two options for performing the cluster management role in the distributed cache cluster. If you store your cluster configuration settings in a SQL Server database, you have the choice of letting that same instance of SQL Server perform the cluster management role (offloading) or letting the lead hosts do the job (onloading). The onloading scenario is recommended so that SQL Server is not a single point of failure. If you do use offloading, it is recommended to use a high availability strategy, such as database clustering or mirroring, to keep the database available for cache cluster management responsibilities. If your cache cluster does not use SQL Server to store the cluster configuration settings, lead hosts must always perform the cluster management role. This topic provides a general overview of how to set the cluster management role. For more information about the role, see Lead Hosts and Cluster Management (AppFabric 1.1 Caching).

Note

You only need to follow this procedure only if you wish to change the lead host management settings on the cache cluster.

To change the cache cluster from XML onloading to SQL Server onloading

It is possible to change a cache cluster from using XML as the cache cluster configuration store to using SQL Server for that data. By default, these steps change the cache cluster from using XML onloading to using SQL Server onloading.

  1. Use the Export-CacheClusterConfig Windows PowerShell command, and save the configuration in a text file called OldConfig.txt.

  2. Run New-CacheCluster pointing to an existing SQL Server database for the configuration store.

  3. Run Unregister-CacheHost from the old store and Register-CacheHost for the new store for all of the cache hosts.

  4. Run Remove-CacheHost and Add-CacheHost for all cache hosts from the individual machines.

  5. Run Remove-CacheAdmin and Add-CacheAdmin for all the administration machines from those machines.

  6. Run Remove-CacheCluster on the older XML store.

  7. Use the Export-CacheClusterConfig to export the configuration for the new cache cluster in a file called NewConfig.txt.

  8. Replace the advancedProperties element in NewConfig.txt with the one from OldConfig.txt exported previously. Save NewConfig.txt, and then use Import-CacheClusterConfig on NewConfig.txt to import the changes.

  9. Use New-Cache with the required properties for all the caches based on the information in OldConfig.txt.

To change the cache cluster from SQL Server offloading to SQL Server onloading

If you want to change from SQL Server offloading (the default for SQL Server in version 1.0) to SQL Server onloading, you should follow all of the steps in the previous section except you must make sure that the leadHostManagement attribute is set to true in the advancedProperties element. The following example shows this setting.

    <dataCache size="Small">
    <!—Other Settings Here--> 
       <advancedProperties>
            <partitionStoreConnectionSettings leadHostManagement="true" />
        </advancedProperties>
    </dataCache>

To use SQL Server offloading

To use SQL Server offloading, the cache cluster must be created with the New-CacheCluster command and the Offloading parameter set to true. If you import any configuration settings, you must also ensure that leadHostManagement is set to false.

To set the lead host designations for cache hosts

Use the Windows PowerShell command Set-CacheHostConfig to specify "true" or "false" for the IsLeadHost parameter to change the lead host setting for a cache host. The following example makes CacheServer1 a lead host.

Set-CacheHostConfig -IsLeadHost "true" -HostName CacheServer1 -CachePort 22233

Although the cache cluster can be running, the cache host must be stopped before running this command. If the cache cluster is running, use the RefreshNow parameter in the call to Set-CacheHostConfig.

See Also

Concepts

Edit Cluster Configuration Settings
Edit Cache Configuration Settings with Windows PowerShell
Cluster Configuration Settings
Using Windows PowerShell to Manage AppFabric 1.1 Caching Features
AppFabric Caching Configuration Options
AppFabric Caching Concepts (AppFabric 1.1 Caching)
Configuring the Cache Cluster
Using Configuration Methods

  2012-09-12