问题标签 [appfabric-cache]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net - Share Session Between two .net 4.0 web applications (domain and subdomain) using Windows Server AppFabric session cache SECURELY
I have two applications, one on a primary domain and the other on another domain. One is a legacy site and the other is a new site. We are slowly converting the legacy site (4.0) using a mix of classic asp, .Net2 webforms, and MVC3 to the new site (4.5) which uses MVC4. It is not possible to convert the entire legacy site at this time.
The requirement is to seamlessly click a link on either site and transition to the other site. The user should not notice that site1 is not part of site2 and vice-versa. The authentication is a mix of windows auth behind a firewall dmz and external customer facing site using a custom login and SSL.
The user session and data must be shared in some way between app1 and app2. It is a government site so security is of the highest priority. This will also be in a load balanced environment running Windows Server 2012.
I am unsure of the approaches for the following:
The best and most secure way to share these sessions. Appfabric on the Win2012, State Server, and SQL Server (I know AF can use this as a provider) are all fair game.
How to transition the Browser UI Pages seamlessly. I thought about possibly using a master Unified UI menu with IFrames that loaded either App1 or App2. I feel that is not best or most secure method however. The prerequisite will be javascript enabled users only.
I have done research on this topic and looked at Appfabric session cache with the sharedid in the web config, but I am not sure if that is the preferable way to go or if that even meets part of my requirement.
Any assistance would be very much appreciated.
Thank you!
c# - 读取 AppFabric 内容会引发程序集异常
我在 AppFabric 中使用了两个命名缓存:
- CacheA 只是成对的 [string,string],并没有以任何特殊方式使用
- CacheB 是成对的 [string,object](其中 object 是可序列化的类型),用作 ASP.NET MVC4 站点的会话存储
我有一个单独的 VS 项目,它试图枚举缓存的全部内容并输出每个项目:
这对 CacheA 非常有效,但是使用 CacheB 运行它会引发异常(当 cache.GetObjectsInRegion() 返回非空值时):
我看到无法从不同的应用程序读取 azure 缓存数据,并添加了对我的另一个项目的引用,其中包含这些对象在序列化之前的类(我实际上只想查看它们被序列化并存储在缓存中的值),但仅此一项并没有改变任何事情。
windows-server-2008 - AppFabric 缓存压缩是否会导致数据在服务器上被压缩存储?
Windows Server AppFabric 缓存压缩是否会导致数据以压缩方式存储或仅以压缩方式传输?
它是为了节省网络带宽还是同时节省带宽和服务器内存?
请注意,这是一个 Windows Server AppFabric 问题。
appfabric - 如何读取 Appfabric 缓存中存在的所有项目:
我正在尝试开发一个工具(在 Visual Studio 2010,C# 中),它可以读取 Appfabric 缓存中存在的所有项目并将它们存储在表中。我不必使用powershell。
首先我想如果我能得到缓存中存在的所有区域,我可以利用DataCache.GetObjectsInRegion
方法来完成我的任务。但是我无法从缓存中获取所有区域名称,因为它不显示用户定义的区域名称,而只显示默认区域名称,所以现在我放弃了这种方法。
谁能在这里指导我,我的主要目标是读取缓存中存在的所有项目。
appfabric - AppFabric:DataCache.Remove 总是失败
我正在编写代码以从非 Azure AppFabric (v1.1) 中删除缓存条目。在下面的代码片段中,DataCache.Remove 总是返回 false...
按照设计,在上面的代码片段中,cachedData 始终为 != null。
有任何想法吗?
session-state - AppFabric 1.1 用于 .net 2.0 应用程序上的会话状态缓存
是否可以为 .net 2.0 应用程序设置会话状态缓存?我能够让它与 .net 4.0 应用程序一起工作,但对 2.0 没有任何运气。
如果我将提供程序基于 Microsoft.Web.DistributedCache 它会失败,因为它太新了,如果我尝试关闭 Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider 它会抱怨指向 type=" 的 web.config 的格式Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider”。
这甚至可能吗?谁能指出我正确的方向?
谢谢
appfabric - AppFabric 缓存崩溃
场景:
编写了一个后端服务,该服务会定期检查数据库中的新行并将其插入 AppFabric 缓存中。自从两个多月以来,我们一直在使用这种方法。
我们正在使用服务器机器将数据存储到不同区域的缓存中。我们没有使用任何机器集群。它只有一台机器。“默认”缓存区域已分为 3 个区域,用于 3 个不同的环境。每个环境都从其指定的缓存区域访问此机器以获取缓存数据。
它工作正常,直到几天后发生以下情况。我们得到以下异常。
错误代码:ERRCA0016:SubStatus ES0001:连接已终止,可能是由于服务器或网络问题或序列化对象大小大于服务器上的 MaxBufferSize。请求的结果未知。
随后对缓存的访问会引发以下异常: ErrorCode ERRCA0017 : SubStatus ES0001:存在临时故障。请稍后重试。
经过 4 到 5 次尝试,我们得到以下异常。 ErrorCode ERRCA0018:SubStatus ES0001:请求超时。
毕竟,访问缓存会引发以下异常: ErrorCode ERRCA0005 : SubStatus ES0001 :所指区域不存在。使用 CreateRegion API 修复错误。
查看第一个错误 ErrorCode: ERRCA0016 :SubStatus ES0001 : 检查要存储的序列化对象的大小是否大于最大缓冲区大小。但在此之前,这个较大尺寸的对象被保存到缓存中。似乎这不是问题。
可能发生的确切问题是什么?
已编辑:确实查看了 Windows AppFabirc 缓存的事件记录器日志。这是我们在挖掘中发现的。这些是获得的一些常见错误日志。
来源: AppFabricCachingService.Failfast
参数:外部存储的租约已过期:Microsoft.Fabric.Federation.ExternalRingStateStoreException:租约已在 Microsoft.Fabric.Data.ExternalStoreAuthority.UpdateNode(NodeInfo nodeInfo, TimeSpan timeout) 在 Microsoft.Fabric.Federation.SiteNode.PerformExternalRingStateStoreOperations(Boolean& canFormRing, Boolean isInsert, Boolean isJoining) 一般:AppFabric 缓存服务崩溃。外部存储的租约已过期:Microsoft.Fabric.Federation.ExternalRingStateStoreException:租约已在 Microsoft.Fabric.Federation.SiteNode.PerformExternalRingStateStoreOperations(Boolean& canFormRing, Boolean isInsert) 的 Microsoft.Fabric.Data.ExternalStoreAuthority.UpdateNode(NodeInfo nodeInfo, TimeSpan timeout) 过期, Boolean isJoining)}
来源: AppFabricCachingService.Crash
参数:
System.Runtime.CallbackException:异步回调引发异常。---> System.IdentityModel.Tokens.SecurityTokenValidationException:该服务不允许您匿名登录。在 ......
可能的原因
在搜索上述事件日志错误后,发现这可能是由于以下问题引起的。缓存服务器是不同的服务器,并且 SQL 配置用于同一台服务器,其数据库位于不同的服务器上。因此,在从 SQL 数据库获取缓存配置时,在缓存服务器和数据库服务器之间创建连接时会出现一些故障。因此,我们将缓存配置从 SQL 移至 XML。但我们仍然得到了错误。
错误代码 ERRCA0017:子状态 ES0001:出现临时故障。请稍后重试。
错误代码 ERRCA0005:子状态 ES0001:引用的区域不存在。使用 CreateRegion API 修复错误。
经过更多的挖掘,我们猜测问题可能出在这上面。每当没有授予访问权限的机器访问 AppFabric 缓存时,它就会尝试一些尝试次数,然后 appfabric 停止工作。使用 Grant powershell 命令授予对缓存的访问权限后,机器现在可以访问缓存。还要观察几天。
这是一个正当的理由吗?
appfabric - AppFabric Syncing Local Caches
We have a very simple AppFabric setup where there are two clients -- lets call them Server A and Server B. Server A is also the lead cache host, and both Server A and B have a local cache enabled. We'd like to be able to make an update to an item from server B and have that change propagate to the local cache of Server A within 30 seconds (for example).
As I understand it, there appears to be two different ways of getting changes propagated to the client:
- Set a timeout on the client cache to evict items every X seconds. On next request for the item it will get the item from the host cache since the local cache doesn't have the item
- Enable notifications and effectively subscribe to get updates from the cache host
If my requirement is to get updates to all clients within 30 seconds then setting a timeout of less than 30 seconds on the local cache appears to be the only choice if going with option #1 above. Due to the size of the cache, this would be inefficient to evict all of the cache (99.99% of which probably hasn't changed in the last 30 seconds).
I think what we need to implement is option #2 above, but I'm not sure I understand how this works. I've read all of the msdn documentation (http://msdn.microsoft.com/en-us/library/ee808091.aspx) and have looked at some examples but it is still unclear to me whether it is really necessary to write custom code or if this is only if you want to do extra handling.
So my question is: is it necessary to add code to your existing application if want to have updates propagated to all local caches via notifications, or is the callback feature just an bonus way of adding extra handling or code if a notification is pushed down? Can I just enable Notifications and set the appropriate polling interval at the client and things will just work?
It seems like the default behavior (when Notifications are enabled) should be to pull down fresh items automatically at each polling interval.
asp.net-mvc-3 - 使用 AppFabric 1.1 开发用于缓存的 .net MVC3 应用程序
我正在使用 Windows Server AppFabric 1.1 并希望在 asp.net MVC3 应用程序中使用缓存。我该如何开始?我尝试了许多在线示例,但它给出了运行时错误。请帮助我使用示例应用程序或教程。
nhibernate - NHibernate.Caches.AppFabric nuget 包无法与 Azure AppFabric 缓存服务建立连接
用于将 Azure AppFabric 缓存服务用作 NHibernate 的二级缓存的 NHibernate.Caches.Appfabric nuget 包在 Azure SDK 的 V 1.8 中运行良好。
但是,在升级到 VS 2012 和 Azure SDK 2.0 版后,nuget 包已停止工作,并且 AppFabric DLL 无法与 Azure AppFabric 缓存服务建立连接。连接到 Azure AppFabric 缓存服务时出现以下错误:
在 Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable 1 servers, RequestBody request, Func
3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) 在 Microsoft.ApplicationServer.Caching.DataCacheFactory.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) 在 Microsoft .ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable 1 servers)
at Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate)
at NHibernate.Caches.AppFabric.AppFabricCacheFactory.GetCache(String cacheName, Boolean useDefault)
at NHibernate.Caches.AppFabric.Adapters.AppFabricCacheNamedAdapter.GetCache(IAppFabricCacheFactory cacheFactory)
at NHibernate.Caches.AppFabric.AppFabricCacheAdapter..ctor(String regionName)
at NHibernate.Caches.AppFabric.Adapters.AppFabricCacheNamedAdapter..ctor(String regionName)
at NHibernate.Caches.AppFabric.AppFabricCacheAdapterFactory.Create(String regionName)
at NHibernate.Caches.AppFabric.AppFabricProvider.BuildCache(String regionName, IDictionary
2 properties) at NHibernate.Cache.CacheFactory.CreateCache(String usage, String name, Boolean mutable, Settings settings, IDictionary`2 properties) at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg、IMapping 映射、Settings 设置、EventListeners 监听器)
==================================================== ===
你能建议如何解决这个问题吗?
谢谢