Introduction
When creating the Search Service application , a default topology will be built automatically where all Search components are assigned to the server which is running the Central Administration, in multi servers farm scenario you need to change this topology , the only available way currently is through PowerShell which will provide more flexibility in configuring the topology, (you can NOT modify the topology through UI like you used to do with SharePoint 2010)
Sample Topology
I will guide you in this post on how to configure 5 servers as the following:
- 3 front servers running the Query Processing component to handle search query requests from users, the query processing components will be located in the WFE servers.
- 2 backend servers servers running the rest of Search components , The rest of search components will be located in the Application servers.
- We will configure the below topology to have all Search components high available (no single point of failure for any components) , even the index partition will be replicated to the other server (replica)
you can refer to the below diagram to have better understanding for the topology we are about to configure:
Before you start
- make sure that the current user who is going to execute the power shell is added as admin to Search service application
- Make sure to run the below Powershell commands on the server that is hosting the Central Administration
- from Central administration – Search Administration page , make sure the index files are empty , Searchable items appears as 0
now let us start by opening the powerShell on the server running the Central administration, make sure to execute all the below commands in the same PowerShell screen, but I have divided them in below to make them more readable:
where SPAPP-SRV1, SPAPP-SRV2, SPWF-SRV1, SPWF-SRV2, SPWF-SRV3 are the server names
Prepare the topology variables
$hostApp1 = Get-SPEnterpriseSearchServiceInstance -Identity "SPAPP-SRV1" $hostApp2 = Get-SPEnterpriseSearchServiceInstance -Identity "SPAPP-SRV2" $hostWF1 = Get-SPEnterpriseSearchServiceInstance -Identity "SPWF-SRV1" $hostWF2 = Get-SPEnterpriseSearchServiceInstance -Identity "SPWF-SRV2" $hostWF3 = Get-SPEnterpriseSearchServiceInstance -Identity "SPWF-SRV3" Start-SPEnterpriseSearchServiceInstance -Identity $hostApp1 Start-SPEnterpriseSearchServiceInstance -Identity $hostApp2 Start-SPEnterpriseSearchServiceInstance -Identity $hostWF1 Start-SPEnterpriseSearchServiceInstance -Identity $hostWF2 Start-SPEnterpriseSearchServiceInstance -Identity $hostWF3 |
Get services status
Get Search Service Instance status (started or stopped) after running the above commands
Get-SPEnterpriseSearchServiceInstance -Identity $hostApp1 Get-SPEnterpriseSearchServiceInstance -Identity $hostApp2 Get-SPEnterpriseSearchServiceInstance -Identity $hostWF1 Get-SPEnterpriseSearchServiceInstance -Identity $hostWF2 Get-SPEnterpriseSearchServiceInstance -Identity $hostWF3 |
Setting up the topology
$ssa = Get-SPEnterpriseSearchServiceApplication $newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa --SPAPP-SRV1 New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 -IndexPartition 0
--SPAPP-SRV2 New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp2 New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp2 New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp2 New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp2 New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp2 -IndexPartition 0 --SPWF-SRV1 , SPWF-SRV2 , SPWF-SRV3 New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostWF1 New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostWF2 New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostWF3 |
--Activate the Topology
Set-SPEnterpriseSearchTopology -Identity $newTopology
-- Verify the Topology
Get-SPEnterpriseSearchTopology -SearchApplication $ssa