创建新索引组件并将其添加到克隆拓扑?
-
10-12-2019 - |
题
我在搜索服务应用程序中爬行包含480k项目的文件服务器。 SharePoint Server只有一个具有20 GB可用空间的系统磁盘,并且没有其他服务器可用。在爬行文件服务器时,系统磁盘熄灭空间,因为默认索引文件夹位于C-drive上。我们停止爬行,执行索引重置,并再次运行搜索服务应用程序,但索引组件被打破(在搜索管理页面上检查,并通过PowerShell)。
我们已订购一个新磁盘,用于爬行文件服务器,但尚未使用。我们正在尝试在本地SharePoint内容上进行全面爬网,这是小的),但爬网永远不会结束。可能是因为索引组件不可用。
我有两个选项:
- 删除当前的搜索服务应用程序,然后从头开始,再次重新创建它。
- 创建一个新的索引组件,克隆活动拓扑,将新索引组件添加到克隆(删除损坏的一个),并将克隆拓扑设置为活动的拓扑。
但我没有找到创建新索引组件的方法。是否有可能?
解决方案
As it turned out, this was not an easy task.
Clone Search Topology
At fisrt I tried clone the search topology, replace the failing Index Component, and activate the clone topology - like this following the technet guide Manage the index component in SharePoint Server 2013:
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "SharePointServerName"
# If the Search Service Instance isn't started, run the following command
#Start-SPEnterpriseSearchServiceInstance $hostA
# Wait for ONLINE status, check by using this
#Get-SPEnterpriseSearchServiceInstance $hostA
# When ONLINE, make a clone
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
# Create a new Index Partition (0) - outputs IndexComponent2
New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostA -IndexPartition 0
# Verify that the search service application is running. False=Running, True=Paused
$ssa.IsPaused() –ne 0
# Set the clone as the new topology (takes a while). If Index component is Degraded, this will run with no end
$ssa.PauseForIndexRepartitioning()
Set-SPEnterpriseSearchTopology -Identity $clone
However, having an degraded index component made this action impossible. Reference: SharePoint 2013 Unable to change topology when Generation controller is not active
Create a new Topology
Next step, make a new, fresh topology (using this technet guide: Change the default search topology in SharePoint Server 2013).
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "SharePointServerName"
# If the Search Service Instance isn't started, run the following command
#Start-SPEnterpriseSearchServiceInstance $hostA
# Wait for ONLINE status, check by using this
#Get-SPEnterpriseSearchServiceInstance $hostA
# When ONLINE, make a new topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
# Create new components (one server only)
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
# Set the Admin Component without index
set-SPEnterpriseSearchAdministrationComponent -SearchApplication $ssa -SearchServiceInstance $hostA
# Remove temp Index files, and recreate the folder
$IndexLocation = "C:\Index" # Change to another disk than system disk
Remove-Item -Recurse -Force -LiteralPath $IndexLocation -ErrorAction SilentlyContinue
mkdir -Path $IndexLocation -Force
# Create new index component with a frech index folder
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostA -RootDirectory $IndexLocation -IndexPartition 0
# Activate the topology (either one of the following works)
$newTopology.Activate()
#Set-SPEnterpriseSearchTopology -Identity $newTopology
Up on activation, I got a conflict and failed again.
Exception calling "Activate" with "0" argument(s): "Topology activation failed. An update conflict has occurred, and you must re-try this action. The object Repartition
Info Name=RepartitionInfo was updated by DOMAIN\SPFarm, in the OWSTIMER (11712) process, on machine SharePointServerName. View the tracing log for more information about t
he conflict."
At line:1 char:1
+ $newTopology.Activate()
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SearchTopologyActivationException
Delete current failing Search Service Application
This should be easy, just use Central Administration > Manage Service Application, select the Search Service Application and click delete-button in the ribbon. Failed, again.
In order to make this to work, you need to stop the sptimerv4...
>net stop sptimerv4
... and delete cache files located in \ProgramData\Microsoft\SharePoint\Config\{Guids Folders}
where cache.ini is located. CAUTION: Don't delete the cache.ini-file. Just edit the file and use another six digit random number. When you're done, start the service again. Reference: An update conflict has occurred, and you must re-try this action.
>net start sptimerv4
And finally the ribbon delete-button works. You're failing Search Service Application is gone. Now (finally) you can create a new Search Service Application, with a fresh topology and a working index component.
其他提示
I had the exact same issue as you described where the index component was broken after an Index Reset.
I was ready to roll my sleeves up and work through your detailed steps (thank you by the way) when I resolved it by using the Pause/Resume option.
Why did I try Pause/Resume? Well after I did an IISRESET I found that the Content Sources were stuck on "Paused". Thus I toggled the Pause/Resume option and miraculously it fixed the index component.
EDIT: This was a temporary fix. In the end I had to rebuild the Search Service Application from scratch.
Try this through Powershell:
$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "myserver1"
$ssa = Get-SPEnterpriseSearchServiceApplication
$topology = Get-SPEnterpriseSearchTopology -SearchApplication $ssa
New-SPEnterpriseSearchIndexComponent -SearchTopology $topology -SearchServiceInstance $hostA -IndexPartition 1
Here is more about managed Index Components: http://technet.microsoft.com/en-us/library/jj862355.aspx