Distribute Cache Service Started throwing CacheHostInfo is null exception


Distribute Cache Service Stopped working After Renaming Windows

After renaming Windows server name, Distributed Cache server started throwing error “CacheHostInfo is null” while trying to start service. 

Background:

I've created a Single Server Farm for testing purpose and decided to make it live with Smallest Min Role farm configuration. So I've performed following steps:
  1. Renamed the Windows name to New name.
  2. Configured SharePoint farm successfully with new name.
  3. Run Remove-SPDistributedCacheServiceInstance command to remove Distributed cache service.
  4. Converted Server Role from Single Server to Application with Search
  5. Added WFE server with Web Front End with Distributed Cache role.
  6. Tried to start Distributed Cache service on new server. here comes the problem it started throwing error CacheHostInfo is null.
  7. And in Get-CacheHost return old server name was displayed.

Resolution:

As it was pointing to old server name so created old server name entry in Host File to point to new IP.
On the non-functioning Distributed Cache host, use the following procedures to restore the Distributed Cache host.
1.       At the SharePoint Management Shell command prompt, run the Remove-SPDistributedCacheServiceInstance cmdlet.
2.       At the SharePoint Management Shell command prompt, run the Add-SPDistributedCacheServiceInstance cmdlet.
 Note
If step 1 fails, manually remove the Distributed Cache service, use the following steps.
·       At the SharePoint Management Shell command prompt, type the following syntax.
 
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance=Get-SPServiceInstance | ?{($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
if($serviceInstance -ne $null){
  $serviceInstance.Delete();
}
 

Run Get-CacheHost, if it returns both server names then remove old server otherwise register new server using following command:
$ConnectionString = (Get-SPDatabase | ?{$_.Type -eq "Configuration Database"}).DatabaseConnectionString

Register-CacheHost -Provider "SPDistributedCacheClusterProvider" -ConnectionString $ConnectionString -Account $Account -CachePort 22233 -ClusterPort 22234 -ArbitrationPort 22235 -ReplicationPort 22236 -HostName SPWFE01



After registering new server run Get-CacheHost, it should returns both server names.

Now unregister the old server name:
Unregister-CacheHost -Provider "SPDistributedCacheClusterProvider" -ConnectionString $ConnectionString -HostName "SP19App0"


After un-registering old server run Get-CacheHost it should returns new server name only.
Now run Add-SPDistributedCacheServiceInstance cmdlet to configure distributed cache service. Open Central Admin > System Settings > Manage Services on Server.
Check if Distributed Cache service is displaying Processing, then wait for it to complete processing.
After processing completed, it’ll display yes in compliant column. If it doesn’t update the status from No(processing) to Yes, then run configuration wizard (psconfigui.exe) to configure the server and it’ll do necessary configuration to setup server.

Comments

Post a Comment

Popular posts from this blog

Installation and Configuration of Office Online Server with SharePoint 2019

Workflow Manager 1.0- Installation, Configuration and Issues

SharePoint 2019 Upgrade Part 6: SharePoint Upgrade Issues