Distributed Cache Connection Strings

2017-12-04T11:47:14+00:00 January 2nd, 2015|Sharepoint|

So I’ve been posting a bit about the Distributed Cache recently. Not through any odd or newly found love of the technology, but simply to raise some awareness about it’s presence and to encourage confidence in any junior SharePointeers in the community. So, one of the components you need when configuring the Distributed Cache is a connection string, which (as you probably guessed by the title) is the theme of this post.

In my previous post Administering Distributed Cache in SharePoint 2013, I taught you how to extract the connection string from an existing Distributed Cache deployment. I generally have a fully-configured SharePoint 2013 sandbox environment on standby should I ever need to peek into what a known-working environment looks like; that way I can always compare, note down any environment-specific variables, and if necessary use it to recover a failing system or service.

Before I move on, below is an example of what a connection string might look like and what each component means:

Data Source=SP2013SQL; Initial Catalog=SP2013_Farm_Config; Integrated Security=True; Enlist=False
  • Data Source: This is the name of your SQL instance that hosts the SharePoint Farm configuration database. Ideally, all your SQL connections utilise the SQL Alias feature
  • Initial Catalog: This needs to be the SharePoint Farm configuration database name
  • Integrated Security: This will always be True, unless you are happy exposing your username and passwords in plain text
  • Enlist: This value will always be False

Great, so to elaborate a little from my previous post, follow one of the following two processes to grab the connection string from a working Distributed Cache server. Note that these are the quickest two methods I use, there are others.

Process 1 – Registry

Open the Local Machine (HKLM) registry hive and navigate to the following key:

  • SoftwareMicrosoftAppFabricv1.0Configuration

Locate the “ConnectionString” key and have a look at the value. Easy.

Process 2 – File System

Open Explorer and navigate to the AppFabric installation directory, for example:

  • C:Program FilesAppFabricv1.0
  • C:Program FilesAppFabric 1.1 for Windows Server

Open the “DistributedCacheService.exe.config” file in your text editor of choice and under the “dataCacheConfig” node you should see the “clusterConfig” attribute with the “connectionString” property, for example:

<clusterConfig provider="SPDistributedCacheClusterProvider" connectionString="Data Source=SP2013SQL;Initial Catalog=SP2013_Farm_Config;Integrated Security=True;Enlist=False" />