Sunday, May 31, 2015

SharePoint 2013 PSConfig Wizard Stuck after Upgrade

Occasionally after an upgrade such as a service pack or CU, the SharePoint Products Configuration Wizard (PSConfig) can get stuck. It may happen on one or more servers in your farm. In my case, it happened on my dev box on step 9. Here are the steps to get things moving again. On the server with the issue perform the following:
  1. Terminate the PSConfig task through the Task Manager.
  2. Go to Administrative Tools > Services. Stop the SharePoint Timer service.
  3. Clear the config cache
    1. In Explorer, go to C:\ProgramData\Microsoft\SharePoint\Config
    2. Delete all files EXCEPT the cache.ini file
    3. Open the cache.ini file, change the number shown to 0 and save
  4. Start the SharePoint Timer service
  5. Wait for the cache files to populate again
  6. Open SharePoint Management Shell as an administrator and run the command:

    Psconfig.exe -cmd upgrade -inplace b2b -wait -force

Now in Central Administration and navigate to Upgrade and Migration > Check Upgrade Status. You can verify the upgrade completed successfully.

Sunday, May 24, 2015

Create a SharePoint 2013 Farm

If you are clever, you may have noticed there is order to my previous posts. This is by design. I've been guiding my readers through a step-by-step process of setting up a SharePoint 2013 farm. I know, I'm tricky sometimes!

I did this not only for my readers, but also for myself. I have a terrible memory and so this blog helps me to keep my notes in order. Here is the culmination of all my latest blogging efforts in the order needed to build a SharePoint 2013 farm.

  1. SharePoint 2013 Farm Checklist
    Use this to gather all your necessary information, accounts, and files for your farm.
  2. Turn off UAC on all servers
    This step is very necessary to ensure no hiccups for your install!
  3. Install Prerequisites
  4. Install the Windows updates you gathered (in the checklist)
  5. Disable Loopback
  6. Set up a SQL Alias
  7. Install SharePoint 2013
  8. Configure Managed Accounts
  9. Create Default Service Application Pool
  10. Create Service Application - This is my preferred order:
    1. State Service
    2. Usage and Health Data Collection
    3. Managed Meta Data Service
    4. Search
    5. Secure Store
  11. Set up Virus exclusions
  12. Configure Logging
  13. Set Up IIS Headers
  14. Set up Cache accounts super user and super reader accounts:
  15. Address SVCHOST.exe memory leaks on all servers by Disabling the Windows Update Service
  16. Address Noderunner memory leaks
  17. Remove distributed cache from app servers
  18. Configure SMTP for outgoing email:
  19. Install SharePoint CUs. Be sure to reboot every server in the farm and run the SharePoint config wizard.

    See SharePoint 2013 Build Numbers by Todd Klindt for a comprehensive list of SharePoint updates. My rule of thumb is that I don't install any hotfixes unless I have a serious problem. I'll update CUs about 3 months behind the current date again, if I'm having issues. For example, my farm had many distributed cache issues and so I installed the September 2014 CU which helped greatly. It took a bit of reading through all the CU information to find which CUs were somewhat stable though. I'd be more inclined to install Service Packs, but again waiting for some months to let any bugs get noted first.
  20. Install AppFabric CU
And that's it! 20 "simple" steps to  install SharePoint. Ok, I know it's not simple, but it's not too bad when you have it all organized. Good luck!

Sunday, May 17, 2015

Distributed Cache and AppFabric Update in SharePoint 2013

Distributed Cache problems have been prevalent on SharePoint 2013. To try to circumvent these issues, you should do an AppFabric update on all your servers as part of your initial SharePoint 2013 installation.

In the past, cache updates for SharePoint would be included as part of SharePoint patches. This time around, cache is separated from SharePoint in AppFabric updates. So add that to your list of patches to watch when you are updating SharePoint 2013.

Stop the Distributed Cache Service

If your SharePoint is in production, you should stop the distributed cache service first on the server you will update. Then the cache will move to another one of your servers set up with distributed cache. You may want to check out my post The number of Distributed Cache hosts in the farm exceeds the recommended value (SharePoint 2013) to see where your cache should be set up.

To stop the cache on a server, run SharePoint management shell as an administrator and run the following commands:
asnp *sharepoint*
Stop-SPDistributedCacheServiceInstance -Graceful

Install AppFabric CU

Now you're ready to install the latest AppFabric patch. At the time of this writing, they were up to CU5 – KB2932678. This install is easy, just follow the directions.

Update DistributedCacheService.exe.config File

Next you need to update the DistributedCacheService.exe.config file. This is due to an update that was released in CU3 – KB2787717. You wouldn't know you needed to update the config file unless you read all the write-ups on all the CUs. A new background garbage collector was implemented in this CU. The config file is located at C:\Program Files\AppFabric 1.1 for Windows Server folder and the update is:

    <add key="backgroundGC" value="true">

Start Distributed Cache Service

Now your ready to start the Distributed Cache service again:

$instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache" -and $_.Server.Name -eq $env:computername}

Lather, Rinse, Repeat

Now, do this on all your distributed cache servers one at a time.

Still Not Working?

For some people, this is enough and the service will work again. This didn't quite do it for me. I had to actually unprovision the distributed cache service and reprovision it again to it to work. Here are the steps to do that:
$instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache" -and $_.Server.Name -eq $env:computername}
Then provision it again:


Sunday, May 10, 2015

The number of Distributed Cache hosts in the farm exceeds the recommended value

The error "The number of Distributed Cache hosts in the farm exceeds the recommended value" shows in your SharePoint 2013 Health Analyzer after an initial install of SharePoint. This is because the default is to enable the distributed cache on all servers in the farm. Really, you only need distributed cache on your Web front ends The solution is to removed distributed cache from all your application servers such as your Central Admin and Search servers.

1) Run SharePoint 2013 Management Shell as your install account because it needs a high level of permissions to perform this action.

2) On your app servers only, run the following cmdlet:




Sunday, May 3, 2015

Noderunner Memory Leaks

In addition to the svchost.exe memory leak issue I mentioned in my last article, I also noticed memory leaks for the noderunner. In searching the Web, I discovered this is a fairly common issue with SharePoint 2013. I've made this step a part of my SharePoint 2013 deployment. Below are the steps to resolve the issue:

The node runner application used by SharePoint 2013 preview for search related process slows down the system due to memory leak issues.

1. Open SharePoint Management Shell and type the following cmdlet:

Set-SPEnterpriseSearchService -PerformanceLevel Reduced

2. Open the config file at C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config and change the value of  memoryLimitMegabytes to 200. This sets the maximum limit for memory use.

I found anything less than 200 caused search to fail on my farm.

3. Restart the SharePoint Server Search 15 service.