笔者亲自测试通过的修改SharePoint 2013的Topology脚本记录

#2013-08-26 更新
#Author: ZhongDaoXueYou
#Copyright: 反正也是抄微软的, 大家随便用.

#Routine Starts Here
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}


$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "APP1-SPS2013"
$hostB = Get-SPEnterpriseSearchServiceInstance -Identity "APP2-SPS2013"
Start-SPEnterpriseSearchServiceInstance -Identity $hostA
Start-SPEnterpriseSearchServiceInstance -Identity $hostB

#Wait until all the search service instances are running
#Commands below should return "Online" for both servers.
Get-SPEnterpriseSearchServiceInstance -Identity $hostA
Get-SPEnterpriseSearchServiceInstance -Identity $hostB


$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa

#Topology:
#APP1: AdminComponent, CrawlComponent, ContentProcessingComponent,AnalyticsProcessingComponent
#APP2: QueryProcessingComponent, IndexComponent
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 $hostB
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostB -IndexPartition 0

#To prevent error message "Topology activation failed. Each partition must have at least one index component..."
#"...from the previous topology in the new topology.",
#You may need to reset index in your test environment before you move on.

#Activate the new search topology
Set-SPEnterpriseSearchTopology -Identity $newTopology

#Verify that the new search topology is active, and get the old topology's ID
Get-SPEnterpriseSearchTopology -SearchApplication $ssa

#Remove the old topology object. Replace the ID with your own
$oldTopology = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Identity 35ef8906-b5f2-48bf-a3e5-8b53bdcb69ea
Remove-SPEnterpriseSearchTopology -Identity $oldTopology

#Verify that all components of the new search topology are running correctly
Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text 

 

运行结果

image

 

2013-08-26 更新 运行完脚本后, 可能会发现有些component(比如Index component需要拷贝索引, Admin component需要一些额外的配置)的状态是黄色的三角叹号, 不用担心, 等一下就会变为正常的绿色小勾了.

如果长时间保持黄色的叹号图标, 请检查你的index分区是否还有足够空间. 如果还不行, 就得查看SharePoint 日志排错了.

 

参考资料

=======================

Add Microsoft.SharePoint.PowerShell Snap-In to All PowerShell Windows

http://blogs.msdn.com/b/kaevans/archive/2011/11/14/add-microsoft-sharepoint-powershell-snap-in-to-all-powershell-windows.aspx

Change the default search topology in SharePoint Server 2013

http://technet.microsoft.com/en-us/library/jj862356.aspx

posted on   中道学友  阅读(536)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2010-03-03 nslookup 命令

导航

< 2013年3月 >
24 25 26 27 28 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 1 2 3 4 5 6

技术追求准确,态度积极向上

点击右上角即可分享
微信分享提示