笔者亲自测试通过的修改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
运行结果
2013-08-26 更新 运行完脚本后, 可能会发现有些component(比如Index component需要拷贝索引, Admin component需要一些额外的配置)的状态是黄色的三角叹号, 不用担心, 等一下就会变为正常的绿色小勾了.
如果长时间保持黄色的叹号图标, 请检查你的index分区是否还有足够空间. 如果还不行, 就得查看SharePoint 日志排错了.
参考资料
=======================
Add Microsoft.SharePoint.PowerShell Snap-In to All PowerShell Windows
Change the default search topology in SharePoint Server 2013
分类:
CMD and PowerShell
, SPS 2013
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 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 命令