Share via


Search Service Application fails to connect to Search server

Question

Tuesday, August 13, 2019 2:22 PM

I have been trying to configure my search service using Powershell, and each time I try, my script appears to execute successfully, but the Search Administration page in CA throws errors. This is what I am seeing in Central Admin. (All confidential info has been removed). The app pool is running under the search service managed account, and is a different account than the crawling account (also a managed account).

System Status
Administrative status Running 
Crawler background activity None 
Recent crawl rate 0.00 items per second 
Searchable items Could not connect to server <server>. This error might occur if the firewall or proxy configuration is preventing the server from being contacted. 
Recent query rate  0.00 queries per minute 
Default content access account <user id> 
Contact e-mail address for crawls <email address>
Proxy server for crawling and federation None 
Search alerts status 
On  Disable 
Query logging 
On  Disable 
Global Search Center URL Set a Search Center URL 

Search Application Topology
Unable to retrieve topology component health states. This may be because the admin component is not up and running.

This is the script I ran:

# Add SharePoint PowerShell functionality to PowerShell ISE
Add-PSSnapin microsoft.sharepoint.powershell

Write-Host "Creating Service Application & Databases"
#Creating the Service Application
$sa = New-SPEnterpriseSearchServiceApplication -Name "Search Service Application" -DatabaseName "SearchDB" -ApplicationPool "SearchService_AppPool"

Write-Host "Application created...Creating Proxy"
#Create the Application Proxy
New-SPEnterpriseSearchServiceApplicationProxy -Name "Search Service Application Proxy" -SearchApplication $sa

#Validate that the Service Instance is online
$si = Get-SPEnterpriseSearchServiceInstance -Local

Write-Host "Proxy created...Cloning topology"
#Clone the Topology
$clone = $sa.ActiveTopology.Clone()

Write-Host "Topology cloned...Creating Admin components"
#Admin and Processing Components
New-SPEnterpriseSearchAdminComponent -SearchTopology $clone -SearchServiceInstance $si
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $clone -SearchServiceInstance $si
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $clone -SearchServiceInstance $si

Write-Host "Admin components created...Creating Crawl Component"
#Crawl
New-SPEnterpriseSearchCrawlComponent -SearchTopology $clone -SearchServiceInstance $si

Write-Host "Crawl component created...Creating Index files"
#Index and Query
New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $si -IndexPartition 0 -RootDirectory "S:\SearchIndex\
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $si

Write-Host "Index created...Activating clone"
#Set the $clone topology as the active topology
$clone.Activate()

Write-Host "Clone activated...Remove inactive topology" 
#Clean up non active topologies
foreach($topo in (Get-SPEnterpriseSearchTopology -SearchApplication $sa | ?{$_.State -eq "Inactive"})){Remove-SPEnterpriseSearchTopology -Identity $topo -Confirm:$false}

Write-Host "Set Crawl Account" 
#Change the default content access account
$search = Get-SPEnterpriseSearchServiceApplication
$content = New-Object Microsoft.Office.Server.Search.Administration.Content($search)
$content.SetDefaultGatheringAccount("<domain\user id>", (ConvertTo-SecureString "<password>" -AsPlainText -Force))

Write-Host "Search Service provision complete."

And these are the results from the script.

PS C:\Windows\system32> C:\IT\Scripts\Search Service Provision.ps1
Creating Service Application & Databases
Application created...Creating Proxy

DisplayName          TypeName             Id                                  
                       --                                  
Search Service Ap... Search Service Ap... 8619df24-cde6-47df-bbd9-c7a03ad90efd
Proxy created...Cloning topology
Topology cloned...Creating Admin components

ComponentId           : 0c4abc40-c6a1-4dd2-804b-94a941f005b2
TopologyId            : 883eb2a1-b6f3-493d-9560-1261c944a98c
ServerId              : f1b23ecf-8d0e-42cd-a68c-6ed306a20478
Name                  : AdminComponent1
ServerName            : <server>
ExperimentalComponent : False

ComponentId           : 7d6394ca-7235-42bf-a073-e75d608daff1
TopologyId            : 883eb2a1-b6f3-493d-9560-1261c944a98c
ServerId              : f1b23ecf-8d0e-42cd-a68c-6ed306a20478
Name                  : ContentProcessingComponent1
ServerName            : <server>
ExperimentalComponent : False

NumProcessingTasksInParallel : 4
MaxSortMemoryInMB            : 400
ComponentId                  : 2dfe771a-d286-4961-858e-ae3316ba6e06
TopologyId                   : 883eb2a1-b6f3-493d-9560-1261c944a98c
ServerId                     : f1b23ecf-8d0e-42cd-a68c-6ed306a20478
Name                         : AnalyticsProcessingComponent1
ServerName                   : <server>
ExperimentalComponent        : False

Admin components created...Creating Crawl Component

ComponentId           : fd336040-113d-48ad-9ade-2615a463219d
TopologyId            : 883eb2a1-b6f3-493d-9560-1261c944a98c
ServerId              : f1b23ecf-8d0e-42cd-a68c-6ed306a20478
Name                  : CrawlComponent1
ServerName            : <server>
ExperimentalComponent : False

Crawl component created...Creating Index files

IndexPartitionOrdinal : 0
RootDirectory         : S:\SearchIndex\
ComponentId           : 48a5bf1b-d047-4084-a78d-4376bc14b805
TopologyId            : 883eb2a1-b6f3-493d-9560-1261c944a98c
ServerId              : f1b23ecf-8d0e-42cd-a68c-6ed306a20478
Name                  : IndexComponent1
ServerName            : <server>
ExperimentalComponent : False

ComponentId           : 24064714-d414-4ab8-8c01-6814932c3bb1
TopologyId            : 883eb2a1-b6f3-493d-9560-1261c944a98c
ServerId              : f1b23ecf-8d0e-42cd-a68c-6ed306a20478
Name                  : QueryProcessingComponent1
ServerName            : <server>
ExperimentalComponent : False

Index created...Activating clone
Clone activated...Remove inactive topology
Set Crawl Account
Search Service provision complete.

I cannot find anything in the ULS Logs that tells me what the underlying issue is.

We are using Windows Defender with the default settings, and all of the SharePoint servers servers are on the same subnet. If I use Central Admin to create the service application, everything works fine, but I get those ugly database names with the GUIDs. What setting am I missing in my script, that CA completes?

All replies (8)

Thursday, September 19, 2019 7:17 PM âś…Answered | 2 votes

It turns out that the issue is somehow related to Windows Firewall. With the Firewall enabled, Search cannot connect. With it disabled, everything works beautifully. Will have to troubleshoot firewall rules.

Edit 9/23/19

I had to edit inbound firewall rules for the search server, as these were not being opened during the SP Install and configuration. Added a rule called SPSearch 2019

TCP
Specific Ports
808, 32843, 32844, 52541-52550, 52120


Tuesday, August 13, 2019 4:05 PM

Make sure SPSearchHostController Service was running fine. Try restarting the Server where you installed the Search.

Thanks & Regards,

sharath aluri


Tuesday, August 13, 2019 9:15 PM

Did both of these and ran psconfig too. No change.


Thursday, August 15, 2019 3:05 AM

Hi Susan,

Provisioning the WSS Usage Application Proxy using the following PowerShell commands:

$UP = Get-SPServiceApplicationProxy | where {$_.TypeName -like "Usage*"}

$UP.Provision()

In addition, here are a few similar situations, you can refer to it:

https://sharepoint.stackexchange.com/questions/178446/error-unable-to-retrieve-topology-component-health-states-this-may-be-because-t

https://www.sharepointfire.com/2015/03/sharepoint-unable-to-retrieve-topology-component-health-states/

https://social.technet.microsoft.com/Forums/en-US/383ad2cd-d9bc-4701-a6e0-c018c66b3ce4/unable-to-retrieve-topology-component-health-states-this-may-be-because-the-admin-component-is-not?forum=sharepointsearch

Best regards

Itch Sun

Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].

SharePoint Server 2019 has been released, you can click

here to download it.
Click

here to learn new features. Visit the dedicated

forum to share, explore and talk to experts about SharePoint Server 2019.


Thursday, August 15, 2019 4:44 PM

I provisioned the Usage Application when I first built the farm, but re-provisioned it to see if that made a difference. Still getting the same errors.


Monday, August 19, 2019 9:19 AM

Hi Susan ,

I'm not that familiar with the power shell.

You can refer to the following article, compare the power shell commands in the article and the code you write.

https://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=378

https://veronicageek.com/sharepoint/sharepoint-2013/create-the-search-service-application-in-sharepoint-server-using-powershell/2018/03/

Best regards

Itch Sun

Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].

SharePoint Server 2019 has been released, you can click

here to download it.
Click

here to learn new features. Visit the dedicated

forum to share, explore and talk to experts about SharePoint Server 2019.


Thursday, August 22, 2019 9:58 AM

Hi ,

Has this problem been solved?

If you think the replies are helpful to you, please remember to mark them as answers. It will help others who meet the similar question in this forum.

Thank you for your understanding.

Best regards

Itch Sun

Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].

SharePoint Server 2019 has been released, you can click

here to download it.
Click

here to learn new features. Visit the dedicated

forum to share, explore and talk to experts about SharePoint Server 2019.


Thursday, August 22, 2019 1:12 PM

Nothing has helped. I am going to rebuild the farm from the ground up.