EN
Deze inhoud is niet beschikbaar in uw taal, maar wel in het Engels.
0 van 1 hebben dit beoordeeld als nuttig - Dit onderwerp beoordelen

Migrate from AppFabric Caching to Windows Azure Caching

This topic describes how to migrate from Microsoft AppFabric 1.1 for Windows Server to Windows Azure Caching. This type of Caching migration might take place when you move an on-premises application to Windows Azure.

AppFabric supports on-premises cache clusters the use your own servers and network infrastructure. The move to Windows Azure is facilitated by the fact that most of the features and programming model of AppFabric are shared with Windows Azure Caching.

Plan for Migration

Before you migrate your cache-enabled application to the cloud, first review the differences between AppFabric and Windows Azure Caching. For more information, see Differences Between Caching On-Premises and in the Cloud. If you require a feature, such as write-through, that is not available in Windows Azure Caching, you must redesign that part of your solution in order to successfully move to Windows Azure.

Analyze the AppFabric Cache Cluster

All of the caches and their relevant settings must be recreated on a cache-enabled Windows Azure role. The first step is to analyze the AppFabric cache cluster to understand the current on-premises configuration.

  1. On the AppFabric cache cluster, open a Caching Administration Windows PowerShell command prompt.

  2. Run the Get-Cache command without any parameters. This lists the named caches.

  3. For each cache listed, run the Get-CacheConfig command. Pass the cache name as an argument to this command. Record the configuration settings for each cache. The following shows an example of this output.

    PS C:\Windows\system32> Get-CacheConfig TestCache
    
    CacheName                : TestCache
    TimeToLive               : 20 mins
    CacheType                : Partitioned
    Secondaries              : 0
    MinSecondaries           : 0
    IsExpirable              : True
    EvictionType             : None
    NotificationsEnabled     : True
    WriteBehindEnabled       : False
    WriteBehindInterval      : 300
    WriteBehindRetryInterval : 60
    WriteBehindRetryCount    : -1
    ReadThroughEnabled       : False
    ProviderType             :
    ProviderSettings         : {}
    
  4. Run the Get-CacheHost command to see a list of cache hosts in the cache cluster.

  5. For each cache host, run the Get-CacheHostConfig command. Pass the required arguments, the name of the cache host and the caching port (typically 22233). Record the Size parameter for each cache host.

  6. Add the Size values for all cache hosts to determine the overall size of the cache cluster.

Recreate the Cache Cluster in a Cloud Services Project

WarningWarning
It is not supported to install both AppFabric and the Windows Azure SDK on the same development machine. These steps assume that you are using separate machines or that you completely uninstall AppFabric before installating the Windows Azure SDK.

In Visual Studio create a cloud service or open an existing cloud service. Add a Cache Worker Role to the cloud service. For more information, see Windows Azure Caching on Dedicated Roles. This role will provide Caching capabilities for the entire cloud service. The following steps describe how to recreate the named caches.

  1. In Visual Studio, go to the Solution Explorer window.

  2. In the Roles folder, double-click the role that hosts Caching.

  3. In the role properties dialog, select the Caching tab.

  4. Under Named Cache Settings, first, modify the default cache to match the settings for the default cache in the AppFabric cache cluster. Then use the Add Name Cache link to add any additional caches required by your solution. The following screen shot shows several configured named caches.

    Caching Properties for Named Caches
  5. Use the Windows Azure (Preview) Management Portal to create or re-use a storage account. That account should be used in the storage account field on the Caching tab for deployments to the Cloud.

The following table correlates the output from Get-CacheConfig to the settings in the Caching window.

 

Get-CacheConfig setting Caching window setting

CacheName

Name

TimeToLive

Time to Live (min)

Secondaries (0, 1)

High Availability (0 = unselected, 1 = selected)

IsExpirable (True, False)

Expiration Type (True = Absolute, False = None)

EvictionType (None, LRU)

Evication Policy (None, LRU)

NotificationsEnabled (True, False)

Notifications (True = selected, False = unselected)

noteNote
Any AppFabric Caching settings that are not listed here are not supported in Windows Azure Caching.

The cache cluster size can be configured by understanding the relationship between the virtual machine size and the number of running instances of this role. For more information, see Capacity Planning Considerations for Windows Azure Caching.

Migrate Application Code

The final step is to move any application code to the cloud service projects. Note that the namespace and many of the APIs remain the same. The following steps provide migration guidance for each project that requires Caching.

  1. In the Visual Studio project, first remove any references to the AppFabric assemblies.

  2. Next, backup the dataCacheClient sections of the web.config or app.config file.

  3. Remove the dataCacheClient and other caching sections from the web.config or app.config file.

  4. Next, prepare the project to use Windows Azure Caching. For more information, see How to: Prepare Visual Studio to Use Caching for Windows Azure.

  5. Then, manually add the removed dataCacheClient sections back into the web.config or app.config file. The following changes must be made to these sections:

    • Add an autoDiscover element to each section. The identifier attribute must reference the name of the role that hosts Caching.

      <autoDiscover isEnabled="true" identifier="[cache cluster role name]" />
      
    • Remove all hosts, host, and securityProperties elements. These are unnecessary and unsupported in Windows Azure Caching.

See Also


Build Date:

2012-10-26
Vindt u dit nuttig?
(1500 tekens resterend)

Community-inhoud

Toevoegen
© 2013 Microsoft. Alle rechten voorbehouden.
facebook page visit twitter rss feed newsletter