I previously wrote a post about Moving the Query Component to a Web Front End. There were questions in regards to the Index Partition/Index Components as well. However, in the meantime I scaled out some of my SharePoint 2013 Search architecture since I had a new "Index Server" provisioned.
While I'll post all of the details of my "scaling out" search experiences, it is recommended that the Index Partition and Query Components live on the same servers; this is for performance purposes. The more I added to my awesome search results and promoted result blocks across multiple result sources, the slower the search response became. Therefore I decided that we should see what happens if we moved the Index Partition to the web front ends (currently I only have 1 WFE but it would still provide some baseline).
This is all accomplished in PowerShell and/or the SharePoint 2013 Management Console.
Here we go!
Step #1: Get the Search Service Instance and Start on the WFE
#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<WFE Server Name>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi
Step #2: Wait for the Search Service to Come Online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi
In my full script version, I have a loop that continues until the search service is online.
Step #3: Clone the Active Search Topology
#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Step #4: Create the New Index Component on the WFE
#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0
-RootDirectory "E:\SPIndex"
I created a folder named SPIndex on the E: drive of the WFE. Modify this for your own location.
This step generates a new Index Component. I had IndexComponent3 and IndexComponent4 already so my new one was IndexComponent5 (yours will probably be different):
Step #5: Activate the Cloned Search Topology with the New Index Component
#Activate the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone
Once this is complete you may review your search topology:
#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa
Step #6: Monitor the Distribution of the Index
Get-SPEnterpriseSearchStatus -SearchApplication $ssa
The new index component will be degraded until it has sync'ed with the active index components:
In the full script I again have a loop that waits until the new component is Active. Looking at your Search Service Application in Central Admin shows a warning:
Once the new Index Component is active, a new green check appears in the Search Service Application:
Step #7: Clone the Active Search Topology Again
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Step #8: Get the ID of the Index Component to Remove
# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity IndexComponent3).componentID
My component was IndexComponent3 yours may be different.
Use Get-SPEnterpriseSearchStatus -SearchApplication $ssa to see which components you have.
Step #9: Remove the original Index Component
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false
In my case I has had the two components on two servers so I repeated Step #8 and Step #9.
Step #10: Activate Search Topology Again
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone
Step #11: Monitor the Distribution of the Index (this time it should be instantaneous)
Get-SPEnterpriseSearchStatus -SearchApplication $ssa
Once the new search topology is activated the Index Partition is moved to the web front end:
What about other WFEs? I will need to add index components to additional WFEs which will be similiar to the process I used to build out my index components on my index servers. More to come on that.
Full Script (fill in the << >> values)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<WFE Server Name>>"
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
#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0 -RootDirectory "E:\SPIndex"
#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 "IndexComponent5"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity <<Index Component Name>>).componentID
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone
#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "<<New Index Component Name>>"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")
While I'll post all of the details of my "scaling out" search experiences, it is recommended that the Index Partition and Query Components live on the same servers; this is for performance purposes. The more I added to my awesome search results and promoted result blocks across multiple result sources, the slower the search response became. Therefore I decided that we should see what happens if we moved the Index Partition to the web front ends (currently I only have 1 WFE but it would still provide some baseline).
This is all accomplished in PowerShell and/or the SharePoint 2013 Management Console.
Here we go!
Step #1: Get the Search Service Instance and Start on the WFE
#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<WFE Server Name>>"
Start-SPEnterpriseSearchServiceInstance -Identity $ssi
Step #2: Wait for the Search Service to Come Online
Get-SPEnterpriseSearchServiceInstance -Identity $ssi
In my full script version, I have a loop that continues until the search service is online.
Step #3: Clone the Active Search Topology
#Clone Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Step #4: Create the New Index Component on the WFE
#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0
-RootDirectory "E:\SPIndex"
I created a folder named SPIndex on the E: drive of the WFE. Modify this for your own location.
This step generates a new Index Component. I had IndexComponent3 and IndexComponent4 already so my new one was IndexComponent5 (yours will probably be different):
Step #5: Activate the Cloned Search Topology with the New Index Component
#Activate the Cloned Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone
Once this is complete you may review your search topology:
#Review new topology
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa
Step #6: Monitor the Distribution of the Index
Get-SPEnterpriseSearchStatus -SearchApplication $ssa
The new index component will be degraded until it has sync'ed with the active index components:
In the full script I again have a loop that waits until the new component is Active. Looking at your Search Service Application in Central Admin shows a warning:
Once the new Index Component is active, a new green check appears in the Search Service Application:
Step #7: Clone the Active Search Topology Again
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
Step #8: Get the ID of the Index Component to Remove
# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity IndexComponent3).componentID
My component was IndexComponent3 yours may be different.
Use Get-SPEnterpriseSearchStatus -SearchApplication $ssa to see which components you have.
Step #9: Remove the original Index Component
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false
In my case I has had the two components on two servers so I repeated Step #8 and Step #9.
Step #10: Activate Search Topology Again
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone
Step #11: Monitor the Distribution of the Index (this time it should be instantaneous)
Get-SPEnterpriseSearchStatus -SearchApplication $ssa
Once the new search topology is activated the Index Partition is moved to the web front end:
What about other WFEs? I will need to add index components to additional WFEs which will be similiar to the process I used to build out my index components on my index servers. More to come on that.
Full Script (fill in the << >> values)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get Search Service Instance and Start on WFE
$ssi = Get-SPEnterpriseSearchServiceInstance -Identity "<<WFE Server Name>>"
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
#Create New Index Component for Index Partition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $ssi -IndexPartition 0 -RootDirectory "E:\SPIndex"
#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 "IndexComponent5"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active
# Get the Index Search Component ID To Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity <<Index Component Name>>).componentID
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone
#Monitor Distribution of Index
do {$activeState = Get-SPEnterpriseSearchStatus -SearchApplication $ssa | Where-Object {$_.Name -eq "<<New Index Component Name>>"}; Write-Host "Waiting for active distribution: " $activeState.State}
until ($activeState.State -eq "Active")