I’m trying to setup Windows Server AppFabric Cache on my local computer. Eventually I get to the point of connecting my C# .NET application to the distributed cache and I get an error. To confirm that the cache is up and running and configured correctly I execute the “Get-CacheClusterHealth” in PowerShell. When I do this I get the following error:
Get-CacheClusterHealth : ErrorCode:SubStatus:Failed to connect to hosts in the cluster At line:1 char:23 + Get-CacheClusterHealth <<<< -debug + CategoryInfo : NotSpecified: (:) [Get-CacheClusterHealth], DataCacheException + FullyQualifiedErrorId : Microsoft.ApplicationServer.Caching.DataCacheException,Microsoft.ApplicationServer.Cachi ng.Commands.GetCacheClusterHealthCommand
I'm installing AppFrabic Cache on a work computer that is attached to a domain. Since I just need a proof-of-concept I'm using XML provider. In the past I have successfully installed AppFabric Cache in other environments, but having issues installing on my local computer.
Since Appfabric Cache is somewhat of a beast to configure, I thought it would be beneficial that I provide the steps I went through to reproduce the issue:
I finally figured it out. After I registered the host using "Register-CacheHost" I should have called "Add-CacheHost".
After I called "Add-CacheHost" I then called "Get-CacheClusterHealth". I finally got the results I expected.
The primary purpose was to create a Proof-Of-Concept in C# that would access AppFabric Cache on a local computer. When I executed the application which was running under my credentials I received the following error:
This is error seems to be a catch-all error. I've seen this error multiple times for different issues.
Since the application was executing with my credentials I needed to give my account permissions to access the cache. It did this by using "Grant-CacheAllowedClientAccount"
Now the cache is working with my application. I was able to get this to work on a computer that was attached to the domain and also to a computer that was in a workgroup.