Jan 11, 2012

Configure Remote BLOB Storage (RBS) in a SharePoint 2010 Environment

Blog Note:

There are a ton of blogs that go over different aspects of setting up RBS for SP 2010. This is the procedure that I follow for setting up RBS for a single site collection. Many of the steps and code was taken from Microsoft TechNet, MSDN and other blogs.

Overview

This article describes the steps required to configure RBS in a SharePoint 2010 environment.

Rights Requirements

  • You must have the following rights to be able to successfully execute this procedure:
  • You must be a local administrator on the SQL server for the Farm and on every SharePoint Server.
  • You must have SA rights on the SQL server for the Farm.
  • You must be a Farm Administrator for the Farm that needs RBS configured.
  • You must be a Site Collection Administrator on each Site Collection you are configuring for RBS support.

Information Requirements

  • You must have the following information to be able to successfully execute this procedure:
  • Name(s) of the SQL server and the SharePoint server(s)
  • The URL(s) of the Site Collection that you are configuring for RBS support
  • The names of the content database(s) of the Site Collection that you are configuring for RBS support

Placeholders Used in this Procedure

  • <CONTENT DATABASE> = The name of the SharePoint content database as it appears in the SQL Server Management Studio
  • <FQDN> = The FQDN of the SharePoint Web Application
  • <Task_Account> = The task account that has Farm and Site collection administrator access to run the RBS Maintainer scheduled task.

Procedure Outline

  • Enable and change FILESTREAM settings on the SQL server
  • Enable content database(s) to use FILESTREAM
  • Install the RBS Provider on all servers
  • Enable RBS on the specific web application(s)
  • Enable FILESTREAM I/O access

Procedure

Enable and change FILESTREAM settings on the SQL server

  1. Log on to the SQL server for the Farm
  2. Launch the SQL Server Configuration Manager
  3. Right click on the MSSQLSERVER instance
  4. Click Properties
  5. Click the FILESTREAM tab
  6. Check Enable FILESTREAM for Transact-SQL access
  7. Click Apply and OK
  8. Launch SQL Server Management Studio
  9. Open a new query window
  10. Copy and Paste the following code:

    EXEC sp_configure filestream_access_level, 2

    RECONFIGURE

  11. Click Execute

Enable Content Database(s) to Use FILESTREAM

  1. Launch SQL Server Management Studio
  2. Open a new query window
  3. Copy and Paste the following code:

    use [<CONTENT DATABASE>]
    if not exists (select * from sys.symmetric_keys where name = N'##MS_DatabaseMasterKey##')
    create master key encryption by password = N'Admin Key Password !2#4'

  4. Click Execute
  5. Open a new query window
  6. Copy and Paste the following code:

    use [<CONTENT DATABASE>]
    if not exists (select groupname from sysfilegroups where groupname=N'RBSFilestreamProvider')
    alter database [<CONTENT DATABASE>]
    add filegroup RBSFilestreamProvider contains filestream

  7. Click Execute
  8. Open a new query window
  9. Copy and Paste the following code:

    use [<CONTENT DATABASE>]
    alter database [<CONTENT DATABASE>]
    add file (name = RBSFilestreamFile, filename = 'c:\RBS_STORE')
    to filegroup RBSFilestreamProvider

  10. Click Execute

Install the RBS Provider on all servers

  1. Download the RBS Provider install package from http://go.microsoft.com/fwlink/?LinkId=177388 to C:\masters on every server in the farm including the SQL server.
  2. NOTE: Do not run the MSI file directly!
  3. Change directory to c:\masters
  4. On the SQL Server and then the first WFE server run the following command:

    msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="<CONTENT DATABASE>" DBINSTANCE="" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

  5. Run the following command on all other SharePoint servers:

    msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi DBNAME="<CONTENT DATABASE>" DBINSTANCE="" ADDLOCAL="Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer"

  6. Check c:\masters\rbs_install_log.txt on each server after installation:
  7. Search for "Installation completed successfully"

Enable RBS on the specific web application(s)

  1. On one of the SharePoint Farm servers
  2. Open the SharePoint Management Shell on run these commands:

    $cdb = Get-SPContentDatabase –WebApplication http://<FQDN>

    $rbss = $cdb.RemoteBlobStorageSettings

    $rbss.MinimumBlobStorageSize = 1048576

    $rbss.Installed()

    $rbss.Enable()

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

    $rbss | Format-List

Check to see if the content database has been configured

  1. Launch SQL Server Management Studio
  2. Open a new query window
  3. Copy and Paste the following code:

    USE [<CONTENT DATABASE>]

    SELECT *

    FROM dbo.DatabaseInformation

  4. Click Execute
  5. You should see two rows titled "RbsEnabled" and "RbsProvider" with values of "1" and "FilestreamProvider_1" respectively.

Enable FILESTREAM I/O access

  • Log on to the SQL server for the Farm
  • Launch the SQL Server Configuration Manager
  • Right click on the MSSQLSERVER instance
  • Click Properties
  • Click the FILESTREAM tab
  • Check Enable FILESTREAM for file I/O streaming access
  • Check Allow remote clients to have streaming access to FILESTREAM data
  • Click Apply and OK

Grant the SharePoint Application Pool Account Access to the Share and File System

  1. Launch Computer Manager
    1. Expand tree and click Shares
    2. Right click on MSSQLSERVER and click Properties
    3. Click on Share Permissions tab
    4. Click Add…
    5. Enter the SharePoint Application Pool account and click OK
    6. Make sure that Full Control, Change, and Read are selected and click OK
  2. Open Windows Explorer and navigate to the C:\ drive
    1. Right click on RBS_STORE and click Properties
    2. Click the Security tab
    3. Click Edit…
    4. Enter the SharePoint Application Pool account and click OK
    5. Make sure that the account has Full Control rights
    6. Click OK

Setup RBS Maintainer

Note: Ensure that the task account tsk_sp_tasks has Log on as a batch job through GPO

Note: Ensure that the task account has full control rights of the RBS share and directory

  1. Log on to the SharePoint SQL Content Database Server
  2. Launch the Windows Task Scheduler
    1. Click Start
    2. In the run field enter "Task Scheduler"
  3. Click Action
  4. Click Create Task…
    1. Enter "RBS Maintainer" in the Name field
    2. Select the Run whether the user is logged on or not radio button
    3. Click Change User or Group…
    4. Enter the credentials for the account <Task_Account>
  5. Click the Triggers tab
    1. Click New…
    2. Setup a daily task to run at 0'dark:30
  6. Click the Actions tab
  7. Click New…
  8. In the Program/script: field enter the following:

    "C:\Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer\Microsoft.Data.SqlRemoteBlobs.Maintainer.exe" -connectionstringname RBSMaintainerConnection -operation GarbageCollection ConsistencyCheck ConsistencyCheckForStores -GarbageCollectionPhases rdo -ConsistencyCheckMode r -TimeLimit 120

  9. Click OK
  10. Click Yes to the confirmation pop up
  11. Click OK

References:

http://technet.microsoft.com/en-us/library/ee748638.aspx

http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx

http://blogs.technet.com/b/wbaer/archive/2011/02/22/filestream-and-sharepoint-2010.aspx

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/55a8be1e-00f4-4def-bbd6-79a79987663e/

http://bkemmler.blogspot.com/2010/03/enable-filestream-rbs-for-sharepoint.html

http://alipka.wordpress.com/2010/06/19/how-to-disable-rbs-in-sharepoint-2010/

No comments:

Post a Comment