Wednesday, June 5, 2013

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

This blog is part of my Scaling Out Search Series and describes the processes for adding a new admin 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 Admin ComponentNew-SPEnterpriseSearchAdminComponent -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:


My second search server was now complete!


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 Admin Component
New-SPEnterpriseSearchAdminComponent -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")

2 comments:

  1. How about if you don't have an existing Admin component to clone?

    ReplyDelete
  2. then you are adding the first one. you clone the search topology regardless.

    ReplyDelete

Matched Content