1

Am trying t configure the DC-distributed cache for a WFE for my SP 2013 SP1 WITH APRIL 2017 CU - MULTISERVER farm but when i run the powershell cmdlets for creating the DC -Distributed Cache

Add-SPDistributedCacheServiceInstance

it thrown error:

cachehostinf is null

Update: now am getting

failed to connect to hosts in the cluster

cacheinfohostisnull

12
  • 1
    See: sharepoint.stackexchange.com/questions/55076/… Commented Jun 6, 2017 at 18:57
  • 1
    did you ran this Add-SPDistributedCacheServiceInstance? Commented Jun 6, 2017 at 19:05
  • yes, already ran those. the strange thing is that, its perfectly working on my WFE02 and failed in WFE01 server! am following this link : jeremytaylor.net/2015/09/17/… Ran those powershell cmds fro the WFE02 , and worked fine. then i went to WFE01 and run the same , it failed!! Commented Jun 6, 2017 at 19:06
  • 1
    AppFabrice Service is running, check from services console on server? also check this reply sharepoint.stackexchange.com/a/216964/21563 Commented Jun 6, 2017 at 19:52
  • 1
    follow the 4 steps, i mentioned in the that reply. After step 2, go to service console and make sure App fabric service is stopped. if not stop it and change it to disabled. then run the add command and wait for couple of minutes Commented Jun 6, 2017 at 20:11

1 Answer 1

3

1st run this script to clear all the running instances of the DC

$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"  
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername} 

If($serviceInstance -ne $null){ $serviceInstance.Delete()}

Now run this command and it should not show any thing

Get-SPServiceInstance | ? {($_.service.tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService"} | select Server, Status

Now make sure that appfabric service is stoped and start type disabled. Check it from services console.

Finally Run the

Add-SPDistributedCacheServiceInstance

Wait for minutes now check the status again.

Use-CacheCluster 
Get-CacheHost

Update:

If above script is giving you the error of null valued expression you can use the modified commands as below and it works successfully:

$serviceInstance = Get-SPServiceInstance | Where-Object {
    $_.TypeName -like "*Distributed Cache*"}

if ($serviceInstance -ne $null) {
    $serviceInstance.Delete()
} else {
    Write-Host "No Distributed Cache service instance found on this server."
}

After this, run:

Add-SPDistributedCacheSericeInstance

Wait for 2-3 minutes.

Here we go and the service has been started successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.