變更 SharePoint Server 中的預設搜尋拓撲

適用于:yes-img-132013 yes-img-16 2016yes-img-192019 yes-img-se訂閱版本 no-img-sopMicrosoft 365 中的 SharePoint

本文從預設的搜尋拓樸開始,說明如何在新的搜尋拓樸中建立及啟動搜尋元件。 本文中的程序和範例假設最近才安裝了 SharePoint Server 和 Search Service 應用程式,且 SharePoint Server 中沒有內容。 拓樸是雲端混合式搜尋解決方案的一部分時,您也可以使用該程序和範例來管理 SharePoint Server 中的搜尋拓撲。

如果 SharePoint Server 搜尋索引中已有項目,請按照<在 SharePoint Server 中管理搜尋元件在 SharePoint Server 中管理索引元件>中的程序進行。

開始之前

開始之前,請先檢閱下列必要條件。

  • SharePoint Server 已安裝在單一伺服器上,且已建立含有預設搜尋拓撲的Search Service 應用程式。 在預設搜尋拓撲中,所有的搜尋元件均位於主控管理中心的伺服器上。

  • 您是 Search Service 應用程式的管理員。

  • 您已經規劃好目標搜尋拓撲。 Plan enterprise search architecture in SharePoint Server 2016提供企業中搜尋的逐步指引 (包括硬體需求)。 如需網際網路網站的範例伺服器陣列架構和搜尋拓撲,請參閱 SharePoint Server 2016 的技術圖表網際網路網站搜尋架構。 針對企業中的搜尋,我們建議您根據搜尋中預期的項目數,規劃目標搜尋拓撲。

  • 已在所有要裝載搜尋元件的伺服器上安裝 SharePoint Server。 這些伺服器已新增至伺服器陣列,而您是所有這些伺服器的管理員。 您可以在現有部署中建立新的應用程式伺服器或定義應用程式伺服器。

概觀:變更搜尋索引中沒有內容的搜尋拓撲

下列清單提供有關將 SharePoint Server 搜尋索引中不含任何內容之預設搜尋拓撲,變更為新搜尋拓撲的工作概觀。

  • 確認所有編目皆尚未啟動,且 SharePoint Server 搜尋索引為空白。

  • 在所有您要主控搜尋元件的伺服器上啟動 Search Service 執行個體。

  • 建立新的空白搜尋拓撲。

  • 新增搜尋元件至新的搜尋拓撲。

  • 啟動新的搜尋拓撲。

  • 確認搜尋拓撲正在使用中。

範例:從預設的搜尋拓撲變更為小型企業搜尋拓撲

下列程序可在多部伺服器上建立並啟動小型企業搜尋拓撲,如目標搜尋拓撲表格中所規劃。 小型企業搜尋拓撲可使用實體應用程式伺服器上的虛擬機器。 本範例中的所有搜尋元件均設有容錯能力,即所有搜尋元件和索引分割區均部署在個別失效網域中的多部實體機器上。

如果您想要擴充到較大的企業搜尋拓樸或網際網路網站的搜尋拓樸,可以依照相同的程序,但使用不同的變數。

目標搜尋拓撲

實體應用程式伺服器 X) 上的虛擬機器 A (myserver1.example.com 實體應用程式伺服器 X) 上的虛擬機器 B (myserver2.example.com 實體應用程式伺服器 Y) 上的虛擬機器 C (myserver3.example.com 實體應用程式伺服器 Y) 上的虛擬機器 D (myserver4.example.com
管理元件 1

編目元件 1

內容處理元件 1

分析處理元件 1
查詢處理元件 1

索引元件 1 (屬於索引分割區 0)
管理元件 2

編目元件 2

內容處理元件 2

分析處理元件 2
查詢處理元件 2

索引元件 2 (屬於索引分割區 0)
  1. 確認所有編目皆尚未啟動,且主控管理中心之伺服器上的搜尋索引為空白。

    • 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。

    • 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。

    • 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。

    • Verify that the search index is empty. On the Search Administration page, under System Status, verify that Searchable items displays "0".

      注意

      如果 SharePoint Server 搜尋索引中有項目存在,請勿繼續執行此程序。

  • Verify that no crawls have been started. On the Search Administration page, under Crawling, click Content Sources. On the Manage Content Sources page, verify that the Status column for any existing content source displays Idle.
  1. 在伺服器陣列中的其一伺服器上啟動 SharePoint 管理命令介面。

  2. 指定您要新增搜尋元件的新伺服器,啟動這些伺服器上的 Search Service 執行個體 (SSI),並建立 Search Service 執行個體的參照。 在此程式中,我們使用了 [目標搜尋拓撲] 資料表中所列伺服器的範例主機名稱 myserver< *n* > 。 在 Windows PowerShell 命令提示字元處,輸入下列命令:

    $hostA = Get-SPEnterpriseSearchServiceInstance -Identity "myserver1"
    $hostB = Get-SPEnterpriseSearchServiceInstance -Identity "myserver2"
    $hostC = Get-SPEnterpriseSearchServiceInstance -Identity "myserver3"
    $hostD = Get-SPEnterpriseSearchServiceInstance -Identity "myserver4"
    Start-SPEnterpriseSearchServiceInstance -Identity $hostA
    Start-SPEnterpriseSearchServiceInstance -Identity $hostB
      Start-SPEnterpriseSearchServiceInstance -Identity $hostC
    Start-SPEnterpriseSearchServiceInstance -Identity $hostD
    
    
  3. 請稍候,直到所有 Search Service 執行個體均在執行中。 在 Windows PowerShell 命令提示字元中,對每個 Search Service 執行個體輸入下列命令,直到命令回復「線上」狀態:

    Get-SPEnterpriseSearchServiceInstance -Identity $hostA
    Get-SPEnterpriseSearchServiceInstance -Identity $hostB
    Get-SPEnterpriseSearchServiceInstance -Identity $hostC
    Get-SPEnterpriseSearchServiceInstance -Identity $hostD
    
  4. 建立新的搜尋拓撲和新搜尋拓撲的參照。 在 Windows PowerShell 命令提示字元處,輸入下列命令:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    $newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
    
    
  5. 將所有搜尋元件新增至新的搜尋拓撲。 下列Windows PowerShell命令會建立新拓撲的搜尋元件,並將它們指派給新的伺服器。 在這個小型企業搜尋拓撲中,有一個索引分割區,索引分割區 0。 這會以 命令 New-SPEnterpriseSearchIndexComponent 中的 參數 -IndexPartition 表示。 索引分割區在虛擬機器 B 上有一個索引複本,在虛擬機器 D 上有一個索引複本。每個索引複本都會包含完全相同的搜尋索引,並裝載在不同的實體伺服器上,以達到容錯能力。 在 Windows PowerShell 命令提示字元處,輸入下列命令:

    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
    New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostC
    New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostD
    New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostD -IndexPartition 0 
    
    
  6. 啟動新的搜尋拓撲。 在 Windows PowerShell 命令提示字元處,輸入下列命令:

    Set-SPEnterpriseSearchTopology -Identity $newTopology
    
  7. 請確認新的搜尋拓撲正在使用中。 在 Windows PowerShell 命令提示字元處,輸入下列命令:

    Get-SPEnterpriseSearchTopology -SearchApplication $ssa
    
    

    在此範例中,該命令會傳回使用中與非使用中的拓撲概觀:

    TopologyId     : fce8507d-61c6-4498-8038-4fd2d0a62c6e
    CreationDate   : 1/30/2016 2:52:00 AM
    State          : Inactive
    ComponentCount : 6
    TopologyId     : b63d48b2-df5c-41be-a7f4-9abaee483611
    CreationDate   : 1/30/2016 4:30:00 AM
    State          : Active
    ComponentCount : 12
    

    在此範例中的先前拓撲和預設拓撲皆列為非使用中。 此範例中新的使用中拓撲會有 12 項元件。

  8. 確認新搜尋拓撲的所有元件均運作正常。 在 Windows PowerShell 命令提示字元處,輸入下列命令:

    Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text
    

    此命令應傳回所有使用中的搜尋元件清單。 使用中的搜尋元件狀態應顯示為 使用中