Install and configure RBS on SharePoint 2010 and SQL 2008 R2

Here is the link to Technet for RBS http://technet.microsoft.com/en-us/library/ee663474.aspx

For SharePoint 2013, look here http://technet.microsoft.com/en-us/library/ee748631(v=office.15).aspx

Of course I used this guide, this is just a summary of what I did.

Note: RBS is a SQL Server component in 2008 R2 and is persistent through a reconfiguration of the SharePoint farm. So I, who dropped my server from the farm and deleted all my SQL databases, was very please that I could  and create a brand spanking new farm using Todd’s Guide (thanks Todd) for the databases and tada RBS still going perfect.

Remote BLOB Storage (RBS) writes BLOB files to disk instead of SQL. (SAN, NAS, or any other disk for that matter, in our case iSCSI)

What that means is all your content monsters, which normally means multimedia and PDFs, gets stored on disk and not in a table. Woohoo SQL performance.

For us this means an instant 400% performance boost on our intranet site moving from our old farm to the new one, and the new farm has 40% more content.. not too shabby.

You can also specify the minimum size to treat as BLOB, for us that is 100kB.

So how do you do this?

Step 1: Enable FILESTREAM on the database server.

See here How to: Enable FILESTREAM

Step 2: Provision a BLOB store for each content database

In our case only “WSS_Content”, which I will use for the context of this exercise.

  1. In SQL Server Management Studio, select the content DB and create a new query, I prefer dynamic SQL, if it does not suit you, follow the Technet link to see the original code

/*-*-*-*-*-*-*-*-* ﷽‎ *-*-*-*-*-*-*-*-*-*-*-*/
DECLARE @MyContentDB VARCHAR(50), @MyKeyPass VARCHAR(50), @MyBlobStore VARCHAR(150), @SQL NVARCHAR(4000), @DoEet INT
SET @DoEet = 0 /*Make 0 to test, 1 for live*/
SET @MyContentDB = '[WSS_Content]'
SET @MyKeyPass = 'Admin Key Password !2#4' /*Change password to suit you*/
SET @MyBlobStore = 'c:\Blobstore' /*Change location to suit you*/
SET @SQL = 'USE ' + @MyContentDB + '
if not exists (select * from sys.symmetric_keys
where name = N''##MS_DatabaseMasterKey##'')
create master key encryption by password = N'''+ @MyKeyPass + '''
if not exists (select groupname from sysfilegroups where groupname=N''RBSFilestreamProvider'')
alter database ' + @MyContentDB + '
add filegroup RBSFilestreamProvider contains filestream
alter database ' + @MyContentDB + '
add file (name = RBSFilestreamFile, filename = '''+@MyBlobStore+''' )
to filegroup RBSFilestreamProvider'

If @DoEet = 1
BEGIN
 EXEC sp_executesql @SQL
END
ELSE
BEGIN
 PRINT @SQL
END

Step 3: Install the RBS client library on each Web server

Download the msi, but DO NOT install it yet, look for the appropriate link here, it is half way down. Or: Microsoft® SQL Server® 2008 R2 Remote Blob Store X86 Package,X64 Package, IA64 Package

Edit: DO NOT USE THE ONE FROM MS DOWNLOAD.. I used the MS download link to RBS.msi and encountented enless issues, Office files could not upload to SharePoint Use this one http://www.divshare.com/download/15002535-2b6 Drop the MSI under C:\

Here is a little powershell script to do it, I assume if you are reading this that you know how to create and run a ps1 file, if you don’t.. then.. hmmm.. ooh, this is a bit awkward isn’t it.. maybe ask someone.

To install the RBS client library on the on the first Web server:

cd c:\
$contentDB = "WSS_Content"
$instance = "DBInstanceName"
msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="$contentDB" DBINSTANCE="$instance" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

To install the RBS client library on all additional Web and application servers

cd c:\
$contentDB = "WSS_Content"
$instance = "DBInstanceName"
msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi DBNAME="$contentDB" DBINSTANCE="$instance" ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer

To confirm the RBS client library installation

Look in the rbs_install_log.txt file, about 20 lines from the bottom, of you see “Product: SQL Server 2008 R2 Remote Blob Store — Configuration completed successfully.” give yourself a green star.

Step 4: Enable RBS for each content database

Open powershell and run the following commands one at a time ( size 102400, is 102kB)

$cdb = Get-SPContentDatabase <ContentDatabaseName>
$rbss = $cdb.RemoteBlobStorageSettings
$rbss | format-list
$rbss.Installed()
$rbss.Enable()
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
$rbss | format-list
$rbss.MinimumBlobStorageSize=102400

If you get 

$cdb.Update()
Exception calling "Update" with "0" argument(s): "An update conflict has occurr
ed, and you must re-try this action. The object SPContentDatabase Name=WSS_Cont
ent was updated by <User>, in the powershell (xxxx) process, on machine
<machine>. View the tracing log for more information about the conflict."
At line:1 char:12
+ $cdb.Update <<<< ()
 + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
 + FullyQualifiedErrorId : DotNetMethodException

If $cdb.Update() does not work for you, try $cdb.Commit I cannot vouch for the solution but it $cdb.Commit worked for me.

Nice resource as well (http://alipka.wordpress.com/)

Step 5: Test the RBS installation

Simply upload a file larger than your specified MinimumBlobStorageSize and you should see some action in your Blobstore directory. Just make sure you back up the location of the Blob store as part of your backup strategy.

And there you have it folks, RBS.

Adrian

0 views0 comments