Wednesday, June 5, 2013

SharePoint 2013 Search: Adding a New Analytics Component to a Search Server

This blog is part of my Scaling Out Search Series and describes the processes for adding a new analytics component to a new search server:

Get Search Service Instance and Start on New Index Server$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<new index server>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi


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

(The full script contains a loop that waits for the service to come online)

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


Add New Analytics Processing Component
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $clone -SearchServiceInstance $ssi



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


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



Monitor Distribution of Index
Get-SPEnterpriseSearchStatus -SearchApplication $ssa


(The full script contains a loop that waits for the index component to be Active)

The new index component will be "Degraded" until the index is fully synced. Use the -text parameter to retrieve more detailed information.

Once all components are Active, reviewing the Search Application Topology in Central Admin shows the following:

NEXT, I created a New Admin Component.



FULL SCRIPT

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get Search Service Instance and Start on New Index Server
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<new index server>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi


#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 Analytics Processing Component
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $clone -SearchServiceInstance $ssi

#Activate the Cloned 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. Hi there Steve, nice post!

    Is there any way that I can retrieve the status of each Component for the Active Topology using C#?

    I am unable to find anything at present.

    Thanks

    Paul

    ReplyDelete
    Replies
    1. I thought I had something but apparently the only components that have a property collection are the Index components. I created a console app to explore the API. I'll at least post what I have so far. I can't seem to find the status of the components though. Strange. You would think that would be one of the component properties (or members).

      -=Steve

      Delete
  2. When you monitor distribution of index as last step, you use "IndexComponent2". Is that because it's the primary? I've got two IndexComponents (IndexComponent2 and IndexComponent2) running on each of the two WFEs. I am looking to scale out Analytics on the two APP servers, currently it is only running on one APP server.

    ReplyDelete
    Replies
    1. I believe I looked at IndexComponent2 because that wasn't the primary. Either way you can visually see the progress from the Search Service Application in Central Admin. The yellow warning signs show that the index is being brought up-to-date.

      Delete
  3. Good day! Do you know if they make any plugins to protect against hackers?
    I'm kinda paranoid about losing everything
    I've worked hard on. Any recommendations?

    ReplyDelete

Matched Content