问题
we have AppFabric cache cluster server and I can work with it using my dev machine as client. In order to simulate different web servers accessing the cache cluster server, I created a VMWare Virtual Machine and installed Visual Studio 2010 and my web application. From the VM as client, when I try to get cache, I get the following error... Please help.. thanks..
ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)
I noticed that the inner exception was
The server has rejected the client credentials.
So.. after some research.. I added the following line to my config
<securityProperties mode="None" protectionLevel="None" />
So now, my dataCacheClient config looks as follows:
<dataCacheClients>
<dataCacheClient name="default">
<localCache
isEnabled="true"
sync="NotificationBased"
objectCount="10000"
ttlValue="5" />
<hosts>
<host name="MyCacheClusterServerMachine" cachePort="22233" />
</hosts>
<securityProperties mode="None" protectionLevel="None" />
</dataCacheClient>
After the above config change.. I am getting the following error:
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was
My code with out the config is as follows. It works from my dev machine as client but not from the VM as client. I am able to ping the cache cluster server from VM client.
class Program
{
static void Main(string[] args)
{
var config = new DataCacheFactoryConfiguration();
var servers = new List<DataCacheServerEndpoint>();
servers.Add(new DataCacheServerEndpoint("MyCacheClusterServerMachine", 22233));
config.Servers = servers;
var factory = new DataCacheFactory(config);
var cache = factory.GetDefaultCache(); <---- error here ********
var key = "CachedObjectKey";
var obj = cache[key];
if (obj == null)
{
obj = "here is a string to cache";
cache.Add(key, obj);
Console.WriteLine("object was not in cache");
}
obj = cache.Get(key);
Console.WriteLine(obj.ToString());
Console.ReadLine();
}
}
回答1:
The server has rejected the client credentials.
This issue was fixed as soon as VM was added to the same domain as my dev machine.
来源:https://stackoverflow.com/questions/13574306/appfabric-client-virtual-machine-issue