SharePoint Remote Blog Storage (RBS) – Step by Step Install

I just setup RBS/RBS Filestream on my 2010 farm.  Not so sure about the functionality being pushed to the SQL Server team for this.  I really liked the COM based approach of EBS in 2007 (which is now marked as obsolete, but supposedly still supported – and when I say 'supported' I simply mean it still works – going forward in 2010), but hey, when you don't have budget/time, send it off to someone else that does right?  These steps will get your RBS FILESTREAM sql provider working sorry no screen shots, you only get those in the courses.

So why RBS? What is it you ask?  It stands for Remote Blog Storage.  We'll, lets start with the fact that when you add a document to SharePoint goes into the content database (the binary is serialized into a stream and put into the database, but not really put into the database, but a pointer in sql server row to a set of 8k pages somewhere on disk that represents those files).  All documents go into the content database with out discrimination.  Should there be discrimination?  Yep.  Some people would migrate file shares to sharepoint which would include install isos, some being in the gigabyte size.  These days we can safely say that SQL Server it is a high volume transactional store and yes, it has the ability to store blobs, just not as efficiently as some applications would like.  Because of this, IT depts would say "No" don't put that large file in sharepoint. 

Well of course that leads to confusion as to what goes in and out of SharePoint (the fileshare lived another day in 2007).  In 2007, the SharePoint team introduced EBS which was a COM component based implementation of passing off the BLOB to something else to manage.  RBS is the continuing evolution of this with SQL Server becoming the management point.  Now IT Depts can say, sure throw that into SharePoint!  No confustion, SharePoint is now the hub of everything!  IT Depts can set the size at which RBS kicks in and sends the file somewhere else.  If the RBS becomes obsolete there are ways to migrate back into SharePoint or change the RbsID to migrate to a new store (you will see the new RbsId column in the content database).  Writing an EBS or RBS implementation is NOT easy.  I did an EBS for 2007, and I'll be the first and not last to tell you, the COM interactions, memory management, and file manager components require some thought and patience.  That being said, you will be at the mercy of Microsoft and 3rd parties to create scalable robust EBS/RBS implementations for your sharepoint system.

After publishing this, we had a nice twitter conversation about StoragePoint. It has some awesome RBS connectors!  You should check them out!

The detailed TechNet version of RBS install process is here.  Mine is a more condensed version of the basic steps.

If you like this, be sure to follow me on twitter! More to come!

Exercise 1 – Setup RBS FILESTREAM

Purpose:
        Setting
up RBS FILESTREAM is fairly simple.  In this lab we
will configure RBS in SQL Server and then RBS Client for Sharepoint 2010

Result:           
A content database that uses RBS FILESTREAM

Task 1 – Enable
FILESTREAM on SQL Server

  1. Open SQL Server Configuration
    Manager
  2. Click “Sql Server Services”
  3. Right click “SQL Server
    (MSSQLServer)”, select “Properties”
  4. Click the “FILESTREAM” tab
  5. Check all the checkboxes

  1. Click “Apply”
  2. Open SQL Server Management
    Studio
  3. Connect to the localhost
    server
  4. Right click the instance,
    select “Properties”
  5. Click the “Advanced” tab
  6. For the “Filestream Access
    Level, select “Full access enabled”
  7. Click “OK”
  8. Restart the SQL Server
    service

Task 2 – Prep the
databases

  1. Open a query window, run the
    following sql command:


use [WSS_Content_100]

if not exists (select * from sys.symmetric_keys where
name = N'##MS_DatabaseMasterKey##')create master key encryption by password =
N'Pa$$w0rd'

 

  1. Run the following:


if not exists (select groupname from sysfilegroups where
groupname=N'RBSFilestreamProvider')alter database [WSS_Content_100]

 add filegroup
RBSFilestreamProvider contains filestream

 

  1. Run the following:


alter database [WSS_Content_100] add file (name = RBSFilestreamFile, filename
= 'c:Blobstore') to filegroup RBSFilestreamProvider

 

  1. Expand “Databases”
  2. Right click “Databases”,
    select “New Database”
  3. For the name type,
    “RemoteBlobStorage”
  4. Click “Ok”

Task 3 – Install the
RBS Client

  1. Run d:lab workRBS_x64.msi
    • NOTE: This task is to walk you through the GUI of the install
      program to see the various items that you COULD configure, later you will
      see that this is not necessary as we will re-run in a silent mode for
      SharePoint – product team has also suggested that you NOT run this step as it may add extra settings that could cause problems later!)

  1. Click “Next”

  1. Click “I accept the terms…”
  2. Click “Next”
  3. Click “Next”

  1. Click “Next”

  1. Click “Test Connection”
  2. Click “Next”

  1. Click “Next”
  2. Check the “Show the advanced
    configuration options” checkbox

  1. Click “Next”
  2. Review the settings:

  1. Click “Next”
  2. Review the properties of the
    “Maintainer Task”, this is used to clean up orphaned records that may not
    exist in SharePoint anymore (a user deleted the file in the document
    library).  Check all the checkboxes:

  1. Click “Next”
  2. For this lab, set all the
    logging setting to “Verbose”:

  1. Click “Next”
  2. Click “Install” – AGAIN NOTE – this is for FYI only, you should click "Cancel" if doing this for real
  3. Click “OK” in the task window

Task 3 – Configure
SharePoint 2010

  1. Open a SharePoint Management
    Console
  2. Run the following commands
    from the location of the RBS_X64.msi file (this would need to be run
    against each content database that you want to support RBS):


msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi
TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content_100"
DBINSTANCE="servername" FILESTREAMFILEGROUP=RBSFilestreamProvider
FILESTREAMSTORENAME=FilestreamProvider_1

 

msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi
DBNAME="WSS_Content_100" DBINSTANCE="servername"
ADDLOCAL="Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer"

 

  1. Open the rbs_install_Log.txt
    file, at the end of the file, look for:
    • Product: SQL Remote
      Blob Storage — Configuration completed successfully.
  2. You can also check the content database and look for some new tables "mssql*"
  3. Run the following (note this
    only works if the web app has one content database):


$cdb = Get-SPContentDatabase –WebApplication 
http://servername:100

$rbss = $cdb.RemoteBlobStorageSettings

$rbss.Installed()

$rbss.Enable()

$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])

$rbss

 


Task 4 – Test your RBS Provider

  1. On the SQL Server, open the “c:BlobStore”
    folder, this is where your blobs will go by default
  2. Open the team site (http://servername:100)
  3. Add a new document called
    “MyRBSFile” to your document library (make sure it is above 100K as you can set the file size boundary in RBS to move between content db and RBS connectors)
  4. Refresh the c:BlobStore folder,
    you should see a new file in one of the directories
  5. Run the following query
    against your Content database (NOTE: run this against your dev enviornment ONLY so as to not cause any locks on your prod databases):


select ad.SiteId, ad.id, leafname, rbsid

  from alldocs
ad, alldocstreams ads

  where ad.id =
ads.id

  and rbsid is
not null

 

 

 

  1. You should get a query back with information on all
    files that have been submitted to the RBS.
     

Enjoy!
Chris