SharePoint 2010 – The search service is not able to connect to the machine that hosts the administration component

Tengo una granja configurada de dos servidores de SharePoint 2010, uno de ellos (servidor1) mantiene el sitio de Administración Central mientras que el otro (servidor2) los servicios de búsqueda e indexación. Por medio del sitio de Administración Central traté de configurar una “Search Service Application” sin embargo al ingresar en la página de administración de contenido y reglas se presentó el mensaje “The search service is not able to connect to the machine that hosts the administration component…”.

Al revisar y comprobar por medio de la consola de PowerShell el estado del servicio apareció que el nombre del servidor estaba asignado a aquel que no tenía los servicios de búsqueda activos, es decir el servidor1.

Para resolver esto tuve que seguir los pasos indicados en este sitio http://blogs.msdn.com/b/russmax/archive/2009/10/20/sharepoint-2010-configuring-search-service-application-using-powershell.aspx

______________________________________________________________________________

Sample Script

Thanks is in store to Colin at MSFT for taking the cmdlets above and throwing together a great sample script.   Copy the script below and save it as a .PS1 file.

Note:  When provisioning a search service application for hosted “multi-tenant” sites, the following cmd-lets must contain the –partitioned parameter.

  • New-SPEnterpriseSearchServiceApplication (Step 3 below)
  • New-SPEnterpriseSearchServiceApplicationProxy (Step 4 below)

 

Add-PSSnapin Microsoft.SharePoint.PowerShell

# 1.Setting up some initial variables.
write-host 1.Setting up some initial variables.
$SSAName = “ContosoSearch”
$SVCAcct = “Contoso\administrator”
$SSI = get-spenterprisesearchserviceinstance -local
$err = $null

# Start Services search services for SSI
write-host Start Services search services for SSI
Start-SPEnterpriseSearchServiceInstance -Identity $SSI

# 2.Create an Application Pool.
write-host 2.Create an Application Pool.
$AppPool = new-SPServiceApplicationPool -name $SSAName”-AppPool” -account $SVCAcct

# 3.Create the SearchApplication and set it to a variable
write-host 3.Create the SearchApplication and set it to a variable
$SearchApp = New-SPEnterpriseSearchServiceApplication -Name $SSAName -applicationpool $AppPool -databasename $SSAName”_AdminDB”

#4 Create search service application proxy
write-host 4 Create search service application proxy
$SSAProxy = new-spenterprisesearchserviceapplicationproxy -name $SSAName”ApplicationProxy” -Uri $SearchApp.Uri.AbsoluteURI

# 5.Provision Search Admin Component.
write-host 5.Provision Search Admin Component.
set-SPenterprisesearchadministrationcomponent -searchapplication $SearchApp  -searchserviceinstance $SSI

# 6.Create a new Crawl Topology.
write-host 6.Create a new Crawl Topology.
$CrawlTopo = $SearchApp | New-SPEnterpriseSearchCrawlTopology

# 7.Create a new Crawl Store.
write-host 7.Create a new Crawl Store.
$CrawlStore = $SearchApp | Get-SPEnterpriseSearchCrawlDatabase

# 8.Create a new Crawl Component.
write-host 8.Create a new Crawl Component.
New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopo -CrawlDatabase $CrawlStore -SearchServiceInstance $SSI

# 9.Activate the Crawl Topology.
write-host 9.Activate the Crawl Topology.
do
{
$err = $null
$CrawlTopo | Set-SPEnterpriseSearchCrawlTopology -Active -ErrorVariable err
if ($CrawlTopo.State -eq “Active”)
{
$err = $null
}
Start-Sleep -Seconds 10
}
until ($err -eq $null)

# 10.Create a new Query Topology.
write-host 10.Create a new Query Topology.
$QueryTopo = $SearchApp | New-SPenterpriseSEarchQueryTopology -partitions 1

# 11.Create a variable for the Query Partition
write-host 11.Create a variable for the Query Partition
$Partition1 = ($QueryTopo | Get-SPEnterpriseSearchIndexPartition)

# 12.Create a Query Component.
write-host 12.Create a Query Component.
New-SPEnterpriseSearchQueryComponent -indexpartition $Partition1 -QueryTopology $QueryTopo -SearchServiceInstance $SSI

# 13.Create a variable for the Property Store DB.
write-host 13.Create a variable for the Property Store DB.
$PropDB = $SearchApp | Get-SPEnterpriseSearchPropertyDatabase

# 14.Set the Query Partition to use the Property Store DB.
write-host 14.Set the Query Partition to use the Property Store DB.
$Partition1 | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropDB

# 15.Activate the Query Topology.
write-host 15.Activate the Query Topology.
do
{
$err = $null
$QueryTopo | Set-SPEnterpriseSearchQueryTopology -Active -ErrorVariable err -ErrorAction SilentlyContinue
Start-Sleep -Seconds 10
if ($QueryTopo.State -eq “Active”)
{
$err = $null
}
}
until ($err -eq $null)

Write-host “Your search application $SSAName is now ready”