Friday, February 7, 2014

How to add a new Sharepoint Server as WFE in an existing Farm

Over View of the Procedure

We are going to add a new WFE server to an existing SharePoint 2010 Farm in the DNS round robin for rendering sites.

Pre Requisites : We have SharePoint 2010 Installed on a Windows Server 2008 OS (But didn't ran Product Configuration Wizard)


New Server name =ABCD
Database Server = ABCDSQL1\SQL_INSTANCE1
Database name = ABCDSQL1\SQL_INSTANCE1

Steps

1) Log to ther server ABCD with service account.

2) Run the SharePoint Product configuration wizard ->click on next and Select the opion as connect to an exitsting server farm.

3)Specify database server as ABCDSQL1\SQL_INSTANCE1, and database name as ABCDSQL1\SQL_INSTANCE1

4)In Server Farm Product and Patch Status, check for any missing Patches, if found need to install and run PSConfig.

5)If everything went fine till above step, then proceed Next and it will ask for PassPhrase

If Passphrase for the farm was not known then needed to be reset via the following actions: 

-          Open the SharePoint 2010 Management Shell (Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell)
-          Enter this at the PowerShell prompt: 


$passphrase = ConvertTo-SecureString -asPlainText -Force 

-          Input the new passphrase and hit Enter
-          Enter this at the PowerShell prompt: 


Set-SPPassPhrase -PassPhrase $passphrase -Confirm 

-          You will be asked to confirm the passphrase by re-entering it
-          Re-enter the passphrase and hit Enter
-          You will be asked if you are sure that you want to perform this action, type Y (for Yes) and hit Enter
-          Your farm passphrase has now been reset!
 
Entered the new pass phrase within Products and Configuration Wizard



6)Click on advance settings and select option to "do not use the machine to host the website". Click on next

Note: It takes few minutes to get completed.

7) After that generally it will automatically run the configuration wizard for Central Admin and this process may take some long time.

8) Run PSCONFIG again on ABCD server first and then on Application servers, WFE servers etc.

9)Cross check and make sure ABCD server having all Windows services enabled as other WFE servers.

10)Need to enable all SharePoint Services same as other WFE servers

Generally below mentioned are the services we need to look for


11) Then we need to cross verify whether Central Admin, Sites etc are working fine on this new WFE server.

12) Need to work with AD team to add this ABCD server to the Farm for rendering sites for end users as Round Robin.

Thursday, November 28, 2013

SharePoint Blob Cache

1.What is Blob Cache?

Disk-based Caching for Binary Large Objects

A BLOB cache is a disk-based cache that stores binary large objects (BLOBs) such as frequently used image, audio, and video files, and other files that are used to display web pages. Each front-end web server maintains its own BLOB cache. When you enable a BLOB cache, you specify the file types to include in the cache and also the location of the BLOB cache. The first time that a BLOB file is requested, the file is copied from the database to the BLOB cache on the front-end web server. Future requests to the front-end web server for that same file are then served from the file that is stored in the BLOB cache, instead of being served from the database. This reduces the network traffic and the load on the database server.

2.Enabling and modifying disk-based caching for SharePoint sites.

Disk-based caching is disabled by default. To enable and customize the disk-based cache, you must modify the following statement in the web.config file for the SharePoint Web application.

Note : Please edit Web.config file with utmost care, as it may currupt your whole Farm, its recommended to edit this in presence of a skilled SharePoint Developer
 
By default, it looks like this:
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="false" />
In order to improve the performance of your site, the BlobCache should be enabled.
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="true" />
Example:
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" max-age="86400" enabled="false"/>
In the preceding example:
• location is the directory where the cached files will be stored
• path specifies in the form of a regular expression which files are cached based on the file extension
• maxSize is the maximum allowable size of the disk-based cache in gigabytes
• max-age specifies the maximum amount of time in seconds that the client browser caches BLOBs downloaded to the client computer. If the downloaded items have not expired since the last download, the same items are not re-requested when the page is requested. The max-age attribute is set by default to 86400 seconds (that is, 24 hours), but it can be set to a time period of 0 or greater.
• enabled is a Boolean that disables or enables the cache.

3. Flushing the Disk-based Cache:

We can flush the current site collection object cache. To do this, browse to the following location on the web site,
Site collection administration -> site collection object cache -> disk based cache reset.
If we have multiple WFEs in the farm, each WFE will maintain its own copy of Disk-based Cache. SharePoint does not have a Web user interface (UI) to flush the disk-based cache on all the servers in a farm and neither is there an option to select a specific WFE.

When you flush the BLOB cache, you clear the contents of the BLOB cache for a web application. This is useful if the BLOB cache becomes out of sync with the content. For example, after you restore a content database, the BLOB cache will be out of sync with the content. To correct that situation, you must flush the BLOB cache

Caution : Flushing the BLOB cache for a web application affects all site collections in the web application.

Note : Considering SharePoint 2013, We cannot use the user interface to flush the BLOB cache Instead, you use Windows PowerShell and the SharePoint object model to complete this task. 

To flush the BLOB cache

1) Verify that you have the following memberships:

  • securityadmin fixed server role on the SQL Server instance.
  • db_owner fixed database role on all databases that are to be updated.
  • Administrators group on the server on which you are running Windows PowerShell cmdlets.
  • You must read about_Execution_Policies.
  • Add memberships that are required beyond the minimums above.
An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

Note: If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.

2) Copy the following code and paste it into a text editor, such as Notepad.

$webApp = Get-SPWebApplication "<WebApplicationURL>"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
Write-Host "Flushed the BLOB cache for:" $webApp
 
3) Replace <WebApplicationURL> with the URL of the web application whose BLOB cache you want to clear
  

4) Save the file, and name it FlushBLOBCache.ps1.

Note: You can use a different file name, but you must save the file as an ANSI-encoded text file that has the file name extension .ps1.

5) On the Start menu, click All Programs.

6)  Click Microsoft SharePoint 2013 Products.

7)  Click SharePoint 2013 Management Shell.

8)  Change to the directory where you saved the file.

9)   At the Windows PowerShell command prompt, type the following command.
  
./FlushBLOBCache.ps1

4.The option provided in the Administration page for flushing the cache is only to the flush the cache on the web front end to which you are currently browsing.
if you would like to flush the complete binary large object (BLOB) caches associated with a specific Web Application on different Web front-end computers in a farm, then you can use the STSADM command to do so.
STSADM -o setproperty -propertyname blobcacheflushcount -propertyvalue 11 -url http://mywebapp:port

5.Internals of the blob cache functionality within SharePoint:

After enabling blob cache in web.config, do an IISRESET and browse to the /settings.aspx first, instead of home page (Collaboration portal site).
When we browse to the settings.aspx, it will create the following files change.bin, dump.bin and flushcount.bin (all the files will be 1KB in size).
Browse to the home page now, it will create a folder PUBLISHINGIMAGES, all the images rendered from the database will be stored here and the above bin files will also get updated (we can see the difference in file size).
Every time when a new image file is rendered from the database, the image folder gets a copy of the image. The bin files (index) will get updated with an additional entry for the new file.
Every request from client will check the index file first. It will only check the cache index and not the image folder directly for the image. If the index file does not have an entry for the image, then the request is served from the database. During this time, a copy of the image will be stored in the images folder and the index file also gets updated, so that the next request will not go to the database.

6.What happens I manually delete just the image file in the cache folder or the image file in the cache folder gets corrupted?

We will not see the image on the client page; we get a broken image ‘X’.

7.How are these cache files stored?

Filename.extension.cache is the file naming format.

8.What can I do if the cached file gets corrupted?

Recommendation: We can reset the index file. Site settings -> Site collection object cache -> Check the box for “Force this server to reset its disk based cache”. It will completely delete all the images and reset the bin files back to 1KB, so that next request will go to database and the complete index will get rebuilt.
Workaround: If you do not want to reset the complete index. Find out the missing image and copy just that file to the cache folder, name it as “filename.extension.cache”
Refresh the page now; it should pick up the image.

9.How is the Index file maintained?

Every time when the web.config initializes, the index file is loaded from the blobcache folder to memory. All new entries will keep getting updated in index file when in memory.
IISRESET /stop will flush the updated index file from memory to disc within the blobcache folder.
IISRESET /start will load the index file from blobcache folder to memory.
As long as the application pool is alive the index file will be getting updated in memory itself.

10.Can an Index file get corrupt?

Index file corruption is possible only when IIS crash or the index file is overwritten with wrong information. When IIS tries to load the index file from blobcache to memory and identifies that it is a corrupted file (not a valid file), it will get completely rebuilt (flush) as fresh file (1KB), all the old entries and images will be lost.

11.In a farm environment, is there any way of having all the WFEs' blob caches synchronized among each other?

No, this cannot be done because SharePoint maintains the index and the cache files individually on each server.

12.In a single WFE environment using web gardening, how does blob caching function? Is there any sync that happens among the working processes?

Web gardening is not supported.

13.What would be the best way of using blob cache in a farm environment (best practices)?


If the requirement is to “centralize” static cached files, then 3rd party content distribution network (CDN) solutions like Akamai need to be used.
What are the limitations of SharePoint and blob caching in a farm environment?
a. Blob caching does not work with Web Gardening.
b. Blob caching does not synchronize data across WFEs – so we might be seeing different versions of the files for a short duration across different WFE servers.

Reference from: Technet & MSDN Blogs

Friday, November 8, 2013

Quest Recovery Manager for SharePoint Error

We recently had one Security Patch installation MS13-084 on our Server and soon after we started getting issues with Quest Recovery Manager Tool

Cause: Recovery Manager for SharePoint has a list of known versions of SharePoint databases. When a new SharePoint cumulative update or service pack is released, the version of database is changed. RMSP needs to be tested against the new database version
  
                


We fixed this issue with below mention url solution

https://support.quest.com/SolutionDetail.aspx?id=SOL31374

First we gone to the link mentioned in the error 




 Then down load the “Versions.xml” file.


Insert that xml file to the SharePoint Recover Manager Server Root Directory

Note: If there is some “Versions.xml” file in that location, we need to rename it to “Versionsold.xml” before moving the downloaded .xml file 


 
 
Then go to the Recovery Manager Console and remove the existing backup added which gives us error



  Once this backup got removed, then we need to refresh it




It will take some time. For me, it took around 15 minutes to complete with some screens as shown below



After that we need to again add the backup -> Analyze it and then try restoring the site

It should  work

Still getting any error, then we may need to open up a case with Quest/ Dell

Good Luck  :-)
***********************************************************************
                                                                       By Binu P Thomas
Installation Directory of SharePoint Server Corrupted and not able to join a Farm

Problem Scope 


Post installation of SP2 , we are trying to install August 2013 CU , and we are getting an error " The expected version of the product was not found in the system "
 
Product / Version / Service Pack: SP 2010
Operating System / Service Pack: win 2008 R2
Farm Configuration: 14.0.7106.5002
Database Used: Sql 2008
 
CA : - http:// abcd:11111/

Environment  


Farm Configuration: 14.0.7106.5002 (August 2013)
 
Root Cause


Corrupt installation of SharePoint on the server Server1  
The following KB’s were missing from the respective servers
 Description of SharePoint Server 2010 SP2
http://support.microsoft.com/kb/2687453
-          Server1 


 Description of the SharePoint Server 2010 cumulative update package (SharePoint server-package): August 13, 2013
http://support.microsoft.com/kb/2825949 
-          Server1
-          Server2
-          Server3
-          Server4
 
Resolution 
 
Server1  has corrupted sharepoint installed files and was not joined to the farm.  


1) Ran the setup file of sharepoint to reinstall/repair it and to join in the farm. 
2) We didn't get any repair option but the setup file asked us to install sharepoint. 
3) When we went for the installation option as mentioned in step 2 above, installation completed successfully but after that when configuration wizard is run, it failed with "Failed to secure the SharePoint resources" 
 
On the WFE that doesn't want to join the farm (Server1) performed the following
-          Open registry editor and navigate to My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDb.
-          Does the key "Dsn" exist ? YES
-          If so, take backup of the key and then delete it. 


Note: To take a backup of the registry key you can select the specific key and then File > Export which will create the backup for you. This registry key only needs to be deleted if we are having issues getting passed connecting to the configuration database. This registry key holds the connection to the configuration database and that is why we removed it so that when we ran the config wizard it will prompt to connect to the existing farms configuration database. 

 Ran the Products and Configuration Wizard on Server1, it now prompts to join to existing farm
 The wizard then complained about the following KBs missing that need to be installed
 Description of SharePoint Server 2010 SP2
http://support.microsoft.com/kb/2687453 
 
Description of the SharePoint Server 2010 cumulative update package (SharePoint server-package): August 13, 2013 


http://support.microsoft.com/kb/2825949  

 Installed both updates
 Completed successfully
 Ran a refresh on the Products and Configuration Wizard it now indicated that the following servers are missing KB2825949
Server2
Server3
Server4
 
Installed the KB on the remaining servers 


 Once installed the installation continued 


 Passphrase for the farm was not known and needed to be reset via the following actions: 


-          Open the SharePoint 2010 Management Shell (Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell)
-          Enter this at the PowerShell prompt: 


$passphrase = ConvertTo-SecureString -asPlainText -Force 

-          Input the new passphrase and hit Enter
-          Enter this at the PowerShell prompt: 


Set-SPPassPhrase -PassPhrase $passphrase -Confirm 

-          You will be asked to confirm the passphrase by re-entering it
-          Re-enter the passphrase and hit Enter
-          You will be asked if you are sure that you want to perform this action, type Y (for Yes) and hit Enter
-          Your farm passphrase has now been reset!
 
Entered the new pass phrase within Products and Configuration Wizard on Server1 


 Products and Configuration Wizard completed successfully 


 Verified via Check Central Administration > Manage Servers in the Farm
 We can now see Server1 - No Action Required 


 The environment has been successfully upgraded to August 2013 Cumulative Update 



************************************************************************************
                                                                                                      By Binu P Thomas
 

Saturday, November 2, 2013

Installing Service Pack 2, Cumulative Update and PSCONFIG on a SharePoint 2010 Farm

 This is one of the activity we performed in our Production and it was successful.
 
Environment Over View

Windows 2008 R2
SharePoint 2010 SP1
Scope of Work : Need to Upgrade to SharePoint 2010 SP2 -> then need to install August 2013 Cumulative Update Package ->Reboot Server ->Run PSCONFIG

If you are applying the patch in the production farm, plan it properly and backup the DBs before applying the patch.  
For Installing CU the order is as follows
Application Servers -> Web Front End Servers -> Other servers 
Step1
First we need to download and keep the SP2 & CU in Server locations
URL for SP2 : http://www.microsoft.com/en-us/download/details.aspx?id=39672 
Below security update is pre installed in our servers 
How to Run

Login to Mentioned Servers with Service Account and  run the SP2 executable file located at D\\Server Location\SP2 (Assuming this is the location you kept the file) -> Wait till in completes successfully
Now run the CU executable file  located at  D\\Server Location\AUG2013CU in each servers. 

Please read this link to know more about this CU installation 
After installing SP2 and CU each server, run the Post Setup Configuration Wizard in the Application server

Then execute the PSCONFIG command on each servers. Please  run PSCONFIG on one server at a time and this needs to run as administrator from the command prompt.

PSCONFIG command mentioned below
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
 
or  
PSConfig.exe –cmd upgrade –inplace b2b –wait -force
 
Execute PSCONFIG from directory location : C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN 


Whenever we use PSConfig wizard , it will issue a timer job to do the upgrade, notice that in the command line version there are two parameters –wait and –force, -wait means do not issue a timer job instead do the upgrade directly, -force will remove any timer jobs stuck while running PSConfig wizard previously.

If there are any issues you will get more information about the exact exception from the PSConfig Setup logs from the 14/logs/ folder.

Note : Generally we can validate whether to run PSCONFIG in any Farm by giving below command from Power shell (Run as Administrator)

 (get-spserver $env:computername).NeedsUpgrade

If result is true -> then need to run PSCONFIG
If result is false->then no need to run PSCONFIG  

How to Validate our Installation

First check the version number of your SharePoint Server farm.  

a) Open Central Administration -> System Settings -> Manage Servers in this farm (under servers) 

This page will list out all servers with the details of language packs, services and the configuration database version. Status column will inform you whether we need any further action or not in any of the servers (eg: if you haven’t run the PSConfig wizard)

b) Next step is checking the upgrade status.

Central Administration -> Upgrade and Migration -> Check upgrade status.

c) Next step is review the database status

Central Administration -> Upgrade and Migration -> Check upgrade status.

d) Next step is check the product and patch installation status

Central Administration -> Upgrade and Migration -> Check product and patch installation status.

e) Run Stsadm –o localupgradestatus

This is to get the complete information for successful upgrades. You have to run it as an administrator in all SharePoint Servers in the farm.

f) Once all tests are done then test SharePoint sites, service applications etc. 

For more information click on below link

Updates for SharePoint 2010 Products 

Good Luck and Happy Patching :-) 

Issues Observed After SP2 & August CU Update

1) In one of WFE Server we are seeing several errors related to Blob Caching in the ULS Logs / Application Events

An error occurred in the blob cache. The exception message was: 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Critical Error : 5538

It seems to be a known bug associated with the SP2 Package and as per MS this will get fixed by next CU release. We are thinking about some troubleshooting like Flushing the Blob cache etc.

Will update soon !!!!!