Thursday, May 30, 2013

SharePoint 2013 Search: Add a Query Component to a New Web Front End

I previously moved the query component to my single web front end server (WFE) and then moved the index partition . Now I have a second WFE provisioned and I wanted to create a query and an index component on that server as well. This post outlines the steps for the query component. The index component was next and those steps are outlined here.


Get Search Service Instance and Start on New WFE Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<NEW WFE SERVER NAME>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity "<<NEW WFE SERVER NAME>>"


Wait for Search Service Instance to come online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi

In the full script I have a loop that waits for the service to become online.
 

Clone the Active Search Topology$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active





Add the New Query Processing Component
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $ssi


Activate  the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone

Optionally Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa

Monitor/Verify the Search Status
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

In the full script I have a loop that waits for the index component to become active. If you have two index components, one usually needs to be re-synced.

You may use the -text parameter to get additional information about the search component statuses:

Get-SPEnterpriseSearchStatus -SearchApplication $ssa -text


I now have a Query Processing component on two web front ends:

{click image to see larger view}

Next I wanted to expand the index partition across the two WFEs and so I added a new Index Component to WFE2.


FULL SCRIPT (with loops)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get Search Service Instance and Start on New WFE Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<NEW WFE SERVER NAME>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity "<<NEW WFE SERVER NAME>>"

#Wait for Search Service Instance to come online
do {$online = Get-SPEnterpriseSearchServiceInstance -Identity $ssi; Write-Host "Waiting for service: " $online.Status}
until ($online.Status -eq "Online")


#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


# Add New Search Component
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $ssi


# Activate  Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone


#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa


#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "IndexComponent2"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")

6 comments:

  1. Great post! Very helpful, thank you very much!

    ReplyDelete
  2. Hi Steve, I have two WFE's each running an index partition and query processing component similarly to how you've outlined in this article.

    I'm curious if you have run across any of the noderunner.exe and memory hogging issues with various search services running on each SP server that were prevalent in SharePoint 2013 preview version.
    http://blogs.technet.com/b/mpriem/archive/2012/09/05/sharepoint-2013-preview-hungry-search-service.aspx

    Supposedly, it was a known memory leak and fixed in RTM and later but I'm running into the very same problem with the RTM version. Just curious if you've had any of the same issues...Thanks

    ReplyDelete
    Replies
    1. I do see noderunner taking up lots of memory (7gb) on the Web Front Ends. Search is a beast but powerful. It is what I expected based on Microsoft documentation and recommendations. Our WFEs aren't pegged too much so having query and index on them helps balance our search servers.

      Delete
    2. Thanks - was wondering if 7GB seems right to you, about what I'm seeing - it is a beast!

      Delete
  3. Best post on #SharePoint enterprise search PowerShell cmdlets anywhere on the web. Excellent work @stevethemanmann!

    ReplyDelete

Matched Content