2

我可以使用微软企业库缓存负载平衡功能的服务器? 我的情况是我必须位于2负载均衡服务器的网络服务,我用数据库缓存“backingStores”同构象下面EnterpriseLibrary缓存负载平衡功能

<cachingConfiguration defaultCacheManager="Cache Manager"> 
    <cacheManagers> 
     <add name="Cache Manager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="MyDataCacheStorage11"/> 
    </cacheManagers> 
    <backingStores> 
     <add name="MyDataCacheStorage11" type="Microsoft.Practices.EnterpriseLibrary.Caching.Database.DataBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" encryptionProviderName="" databaseInstanceName="EntLib1ConnectionString111" partitionName="CAPwiki Cache"/> 
     <add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="NullBackingStore"/> 
    </backingStores> 
</cachingConfiguration> 

,当我设置缓存与关键“_testorderstatus3”在Server1并尝试从服务器2得到它,它返回NULL值!

还当我从server1的设定相同的密钥值和Server2上重新设置它,我检查DB,我发现它设定的2倍如下图所示 enter image description here

想过这事?我需要设置并获取两台服务器。

谢谢

回答

3

企业库不支持开箱即用的分布式多服务器缓存解决方案。从Chapter 5 of the Developer's Guide

开箱即用的缓存应用程序块不提供跨多个服务器的分布式缓存所需的 功能。

根据你正在尝试做什么,我会看看Windows Server AppFabric Caching Services

的Windows Server AppFabric的为开发可扩展,可用, 高性能应用的分布式内存应用 缓存平台。

+0

谢谢,但有什么办法让企业库分布式多服务器缓存? ,你有没有开箱即用的分布式多服务器缓存解决方案的文档列表? - 谢谢 –

+0

@ TarekEl-Mallah,我相当确信您可以使用Enterprise Library实现分布式多服务器缓存。但是为什么在那里有**开箱即用的解决方案时,要经历所有的开发和测试? –

+0

谢谢,是“Windows Server AppFabric”免费使用还是我必须购买的东西?并且是否有代码示例 –