2013-09-19

I have three servers for SharePoint FARM setup:

  1. mySPDb-SRV -> Database Server
  2. mySPAP-SRV  -> Application server as well as WFE1
  3. mySPWFE-SRV -> WFE2

I need to configure the search on the above FARM topology. My central admin is on my Application server.

So I have decided to configure Search on Application server and attach the instance WFE2.

For this we have only PowerShell cmdlet available.

So I have done it as follows (Please make sure search service must be started on both WFEs):

1- Created Search Service Application 1st on Application server (Where central admin available)

$SearchAppPoolName = "SearchServiceAppPool"


$SearchAppPoolAccountName = "Domain\DomainUser"

$SearchServiceName = "SharePoint Search Service"

$SearchServiceProxyName = "SharePoint Search Service Proxy"


$DatabaseServer = "(IP/MachineName)\DatabaseInstance Name"


$DatabaseName = "SP_Search_AdminDB"


Write-Host -ForegroundColor Red "Checking if Search Application Pool exists" 

$spAppPool = Get-SPServiceApplicationPool -Identity $SearchAppPoolName -ErrorAction SilentlyContinue

if (!$spAppPool)

{

    Write-Host -ForegroundColor Cyan "Creating Search Application Pool"

    $spAppPool = New-SPServiceApplicationPool -Name $SearchAppPoolName -Account $SearchAppPoolAccountName -Verbose

}


Write-Host -ForegroundColor Green "Checking if Search Service Application exists"

$ServiceApplication = Get-SPEnterpriseSearchServiceApplication -Identity $SearchServiceName -ErrorAction SilentlyContinue

if (!$ServiceApplication)

{

    Write-Host -ForegroundColor Yellow "Creating Search Service Application"

    $ServiceApplication = New-SPEnterpriseSearchServiceApplication -Name $SearchServiceName -ApplicationPool $spAppPool.Name -DatabaseServer  $DatabaseServer
-DatabaseName $DatabaseName

}

Write-Host -ForegroundColor Cyan "Checking if Search Service Application Proxy exists"

$Proxy = Get-SPEnterpriseSearchServiceApplicationProxy -Identity $SearchServiceProxyName
-ErrorAction SilentlyContinue

if (!$Proxy)

{

    Write-Host -ForegroundColor Yellow "Creating Search Service Application Proxy"

    New-SPEnterpriseSearchServiceApplicationProxy -Name $SearchServiceProxyName
-SearchApplication $SearchServiceName

}

Now We have Search Service application and proxy is created. We can find it from Central Admin

2-Configure Search service instances:

#Prepare the topology variables

$hostApp1 = Get-SPEnterpriseSearchServiceInstance -Identity "mySPAP-SRV"

$hostWF1 = Get-SPEnterpriseSearchServiceInstance -Identity "mySPWFE-SRV"


Start-SPEnterpriseSearchServiceInstance -Identity $hostApp1

Start-SPEnterpriseSearchServiceInstance -Identity $hostWF1 


#Get services status

Get-SPEnterpriseSearchServiceInstance -Identity $hostApp1

Get-SPEnterpriseSearchServiceInstance -Identity $hostWF1


(#Wait till SPEnterpriseSearchServiceInstance be online and then execute the below code)


#Setting up the topology

$ssa = Get-SPEnterpriseSearchServiceApplication

$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa

#mySPAP-SRV

#Enterprise Search Admin Component

New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1


 #Enterprise Search Crawl Component

New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1


#Enterprise Search Content Prosessing Conmponent

New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology
-SearchServiceInstance $hostApp1


#Enterprise Search AnalyticsProcessing Component

New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology
-SearchServiceInstance $hostApp1


#Enterprise Search Query Processing Component (As I declared that it will also work as WFE so this needs to be configured. It is not essential to configure on Application server)

New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology
-SearchServiceInstance $hostApp1


#Enterprise Search Index Component

New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostApp1 -IndexPartition 0

#mySPWFE-SRV

#Enterprise Search Query Processing Component

New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology
-SearchServiceInstance $hostWF1

#Set Topology
Set-SPEnterpriseSearchTopology -Identity $newTopology


# Verify the Topology

Get-SPEnterpriseSearchTopology -SearchApplication $ssa

Now here is a catch. topology will throw following error:

Could not connect to the Host Controller service on server. Topology Activation could not be started……..

I have Googled almost 5-6 Hrs and tried each and every solutions. The ended up being with the firewall settings on the SharePoint servers. First, I tried with firewall “off mode” on both SharePoint servers.

I found that it is working fine now.  Then I have created Inbound rule in both SharePoint servers firewall for the above servers port so that they can by pass the servers firewall. And Its done. Working like a charm.

Now this post may save you 4-5 hrs 🙂

About the author 

Ajeet Kumar Singh