在 Compute Engine 上部署 Microsoft SharePoint Server

本教學課程說明如何在 Compute Engine 上部署 Microsoft SharePoint Server。本指南適用於 Microsoft SharePoint Server 2016 和 Microsoft SharePoint Server 2019。

SharePoint 部署作業會使用兩個可用區中的六部伺服器。這項設定對應至「中等高可用性 (搜尋最佳化)」MinRole 伺服器陣列拓撲。

下圖說明部署作業:

部署 Microsoft Exchange

本文假設您已在 Google Cloud 上部署 Active Directory 和 SQL Server,且具備 SharePoint Server、Active Directory 和 Compute Engine 的基本知識。

目標

  • 準備部署 SharePoint Server 的專案。
  • 部署使用六部伺服器的 MinRole SharePoint 伺服器陣列:

    • 兩個前端伺服器,具有分散式快取
    • 兩個應用程式伺服器
    • 兩個搜尋伺服器
  • 設定負載平衡和防火牆規則

費用

本教學課程使用 Google Cloud的計費元件,包括:

使用 Pricing Calculator 可根據您的預測使用量來產生費用預估。

事前準備

如要按照本指南完成操作,您需要:

  • 現有的 Active Directory 網域,至少有一個網域控制器。您可以使用 Managed Service for Microsoft Active Directory,或自行管理的 Active Directory 網域。
  • 具備加入電腦、建立使用者帳戶和新增 DNS 記錄權限的管理 Active Directory。
  • 一個 Google Cloud 專案和虛擬私有雲,可連線至 Active Directory 網域控制器。
  • 已加入 Active Directory 網域且可用於 SharePoint 的 SQL Server 執行個體。如要進一步瞭解如何在 Google Cloud上設定高可用性 SQL Server 部署作業,請參閱「部署多子網路 SQL Server Always-On 可用性群組」。
  • SharePoint VM 執行個體的子網路。子網路必須跨越至少兩個可用區。

開始部署前,請先詳閱 SharePoint Server 2016 和 2019 的系統需求。

  1. 在 Google Cloud 控制台的專案選取器頁面中,選取或建立 Google Cloud 專案。

    選取或建立專案所需的角色

    • 選取專案:選取專案時,不需具備特定 IAM 角色,只要您獲派任何專案角色,即可選取該專案。
    • 建立專案:如要建立專案,您必須具備專案建立者角色 (roles/resourcemanager.projectCreator),其中包含 resourcemanager.projects.create 權限。瞭解如何授予角色。

    前往專案選取器

  2. 確認 Google Cloud 專案已啟用計費功能。

完成本文所述工作後,您可以刪除建立的資源,避免繼續計費,詳情請參閱「清除所用資源」一節。

準備專案和網路

如要準備 Google Cloud 專案和虛擬私有雲,以便部署 SharePoint Server,請按照下列步驟操作:

  1. 在 Google Cloud 控制台中切換至專案,然後開啟 Cloud Shell。

    開啟 Cloud Shell

  2. 初始化下列變數:

    VPC_NAME=VPC_NAME
    SUBNET_NAME=SUBNET_NAME
    SUBNET_REGION=SUBNET_REGION
    SUBNET_ZONE_1=$SUBNET_REGION-a
    SUBNET_ZONE_2=$SUBNET_REGION-b
    

    其中:

    • VPC_NAME 是虛擬私有雲的名稱。
    • SUBNET_NAME 是子網路名稱。
    • SUBNET_REGION 是子網路的區域。
  3. 設定預設專案 ID:

    gcloud config set project PROJECT_ID
    

    將 PROJECT_ID 替換為 Google Cloud 專案 ID。

建立防火牆規則

如要啟用 SharePoint 伺服器陣列伺服器之間的通訊,您必須建立多個防火牆規則。為簡化這些防火牆規則的建立程序,請使用網路標記:

  • 前端伺服器會加上 sharepoint-frontend 標記。
  • 應用程式伺服器會加上 sharepoint-application 標記。
  • 搜尋伺服器會加上 sharepoint-search 標記。
  • 所有伺服器也會加上 sharepoint 標記。

建立防火牆規則,使用這些網路標記,並允許透過 SharePoint 所需的通訊埠進行通訊:

  1. 返回現有的 Cloud Shell 工作階段。
  2. 為 SharePoint 伺服器建立防火牆規則:

    gcloud compute firewall-rules create allow-http-between-sharepoint-servers \
      --direction=INGRESS \
      --action=allow \
      --rules=tcp:80,tcp:443,tcp:32843,tcp:32844 \
      --enable-logging \
      --source-tags=sharepoint \
      --target-tags=sharepoint \
      --network=$VPC_NAME \
      --priority=10000
    
    gcloud compute firewall-rules create allow-search-between-sharepoint-servers \
      --direction=INGRESS \
      --action=allow \
      --rules=tcp:16500-16519 \
      --enable-logging \
      --source-tags=sharepoint \
      --target-tags=sharepoint \
      --network=$VPC_NAME \
      --priority=10000
    
    gcloud compute firewall-rules create allow-rpc-between-sharepoint-servers \
      --direction=INGRESS \
      --action=allow \
      --rules=tcp:135,tcp:49152-65535 \
      --enable-logging \
      --source-tags=sharepoint \
      --target-tags=sharepoint \
      --network=$VPC_NAME \
      --priority=10000
    
    gcloud compute firewall-rules create allow-wcf-between-sharepoint-servers \
      --direction=INGRESS \
      --action=allow \
      --rules=tcp:808 \
      --enable-logging \
      --source-tags=sharepoint \
      --target-tags=sharepoint \
      --network=$VPC_NAME \
      --priority=10000
    
    gcloud compute firewall-rules create allow-appfabric-from-sharepoint-servers \
      --direction=INGRESS \
      --action=allow \
      --rules=tcp:22233-22236 \
      --enable-logging \
      --source-tags=sharepoint \
      --target-tags=sharepoint-frontend \
      --network=$VPC_NAME \
      --priority=10000
    
  3. 建立防火牆規則,允許所有伺服器連線至 SQL Server 執行個體。如果 SQL Server 執行個體使用網路標記 sql-server,您可以使用下列指令建立防火牆規則:

    gcloud compute firewall-rules create allow-sql-from-sharepoint-servers \
      --direction=INGRESS \
      --action=allow \
      --rules=tcp:1433 \
      --enable-logging \
      --source-tags=sharepoint \
      --target-tags=sql-server \
      --network=$VPC_NAME \
      --priority=10000
    

    如果 SQL Server 執行個體未使用網路標記,請參閱「建立防火牆規則」,瞭解建立防火牆規則的其他方法。

專案和虛擬私有雲已準備就緒,可以部署 SharePoint。

建立安裝磁碟

下一步是建立包含 SharePoint Server 安裝媒體的磁碟。建立可附加至多個 VM 執行個體的磁碟,就不必將安裝媒體個別下載至每個 VM 執行個體。

  1. 按照「從 ISO 檔案建立映像檔」中的操作說明進行。請使用下列網址做為下載網址:

    SharePoint Server 2016

    https://download.microsoft.com/download/0/0/4/004EE264-7043-45BF-99E3-3F74ECAE13E5/officeserver.img
    

    SharePoint Server 2019

    https://download.microsoft.com/download/C/B/A/CBA01793-1C8A-4671-BE0D-38C9E5BBD0E9/officeserver.img
    
  2. 使用新映像檔在第一個可用區建立磁碟:

    gcloud compute disks create sharepoint-media-1 \
      --zone=$SUBNET_ZONE_1 \
      --image-project=$GOOGLE_CLOUD_PROJECT \
      --image=IMAGE
    

    將 IMAGE 替換為您在上一個步驟中建立的映像檔名稱。

  3. 在第二個可用區建立磁碟:

    gcloud compute disks create sharepoint-media-2 \
      --zone=$SUBNET_ZONE_2 \
      --image-project=$GOOGLE_CLOUD_PROJECT \
      --image=IMAGE
    

    將 IMAGE 替換為您在第一個步驟中建立的映像檔名稱。

建立 SharePoint 映像檔

為避免在所有伺服器上個別安裝 SharePoint 元件的重複工作,您現在要建立自訂 VM 映像檔。稍後您會將這個 VM 映像檔做為虛擬機器範本,用於部署 SharePoint 伺服器。

  1. 返回現有的 Cloud Shell 工作階段。
  2. 為 VM 執行個體建立特製化指令碼。指令碼會在 VM 初始化期間執行,並安裝 SharePoint 必要條件:

    cat << "EOF" > specialize.ps1
    $ErrorActionPreference = "stop"
    
    # Allow HTTP/HTTPS redirects so that the prerequisite installer can run
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name WarnonZoneCrossing -Value 0 -Type DWord
    
    # Install prerequisites
    & d:\prerequisiteinstaller.exe /unattended | Out-Default
    
    # Install logging agent
    (New-Object Net.WebClient).DownloadFile(
        "https://dl.google.com/cloudagents/windows/StackdriverLogging-v1-10.exe",
        "$env:Temp\StackdriverLogging-v1-10.exe")
    & $env:Temp\StackdriverLogging-v1-10.exe /S | Out-Default
    
    # Disable Windows firewall (because VPC firewall rules are used instead)
    & netsh advfirewall set allprofiles state off | Out-Default
    EOF
    
  3. 建立 VM 執行個體,並為 specialize 指令碼值指派 specialize.ps1。以唯讀模式連接 SharePoint 安裝磁碟,以便從這個磁碟啟動 SharePoint 安裝程式:

    gcloud compute instances create sp-template \
      --image-family=windows-2019 \
      --image-project=windows-cloud \
      --machine-type=n1-standard-2 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --zone=$SUBNET_ZONE_1 \
      --tags=sharepoint \
      --disk=name=sharepoint-media-1,auto-delete=no,mode=ro \
      --metadata-from-file=sysprep-specialize-script-ps1=specialize.ps1
     
  4. 查看 VM 的序列埠輸出內容,監控初始化程序:

    gcloud compute instances tail-serial-port-output sp-template --zone=$SUBNET_ZONE_1
    

    等待約 10 分鐘,直到看到輸出內容 Instance setup finished,然後按下 Ctrl+C。此時,必要條件的安裝作業已完成,VM 執行個體已可使用。

  5. 為 VM 執行個體建立使用者名稱和密碼

  6. 使用遠端桌面連線至 VM,並使用上一個步驟建立的使用者名稱和密碼登入。

  7. 在「開始」按鈕上按一下滑鼠右鍵 (或按下 Win+X 鍵),然後點選「Windows PowerShell (系統管理員)」。

  8. 按一下「是」,確認權限提升提示。

  9. 啟動 SharePoint 安裝程式:

    & d:\setup.exe
    
  10. 按照精靈的指示操作。系統提示您輸入產品金鑰時,請使用 Sharepoint 下載頁面「Install Instructions」下方列出的「Enterprise trial product key」,或使用您現有的金鑰。

  11. 安裝完成後,按一下「Close」。

  12. 在 PowerShell 中下載並安裝 Chrome:

    Start-BitsTransfer `
        -Source 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' `
        -Destination "$env:Temp\chrome_installer.exe"
    & $env:Temp\chrome_installer.exe
    
  13. 在 Chrome 中下載並安裝下列更新:

    SharePoint Server 2016

    1. Microsoft SharePoint Enterprise Server 2016 安全性更新 (KB4011127)。
    2. Microsoft SharePoint Enterprise Server 2016 更新 (KB4011053)。

    3. 如有需要,請查看並安裝其他更新。

    SharePoint Server 2019

    1. 檢查並視需要安裝更新。
  14. 返回 PowerShell 控制台,並一般化映像檔:

    & gcesysprep
    

    這個指令會自動關閉 VM。請等待約 5 分鐘,讓這項程序完成。

  15. 在 Cloud Shell 中,使用 VM 的開機磁碟建立 VM 映像檔:

    gcloud compute images create sharepoint \
      --source-disk=sp-template \
      --source-disk-zone=$SUBNET_ZONE_1
    
  16. 刪除 VM 執行個體:

    gcloud compute instances delete sp-template --zone=$SUBNET_ZONE_1
    

建立 VM 並加入 Active Directory

請按照下列步驟,為 SharePoint 伺服器陣列建立 VM 執行個體,並將其加入現有的 Active Directory 網域:

  1. 返回現有的 Cloud Shell 工作階段。
  2. 為前端伺服器建立兩個 VM 執行個體:

    gcloud compute instances create sp-frontend-1 \
      --zone=$SUBNET_ZONE_1 \
      --machine-type=n1-standard-8 \
      --boot-disk-size=200 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --tags=sharepoint,sharepoint-frontend \
      --image=sharepoint \
      --image-project=$GOOGLE_CLOUD_PROJECT
    
    gcloud compute instances create sp-frontend-2 \
      --zone=$SUBNET_ZONE_2 \
      --machine-type=n1-standard-8 \
      --boot-disk-size=200 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --tags=sharepoint,sharepoint-frontend \
      --image=sharepoint \
      --image-project=$GOOGLE_CLOUD_PROJECT
    
  3. 為應用程式伺服器建立兩個 VM 執行個體:

    gcloud compute instances create sp-app-1 \
      --zone=$SUBNET_ZONE_1 \
      --machine-type=n1-standard-8 \
      --boot-disk-size=200 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --tags=sharepoint,sharepoint-application \
      --image=sharepoint \
      --image-project=$GOOGLE_CLOUD_PROJECT \
      "--metadata=sysprep-specialize-script-ps1=Add-WindowsFeature RSAT-AD-PowerShell;Add-WindowsFeature RSAT-DNS-Server"
    
    gcloud compute instances create sp-app-2 \
      --zone=$SUBNET_ZONE_2 \
      --machine-type=n1-standard-8 \
      --boot-disk-size=200 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --tags=sharepoint,sharepoint-application \
      --image=sharepoint \
      --image-project=$GOOGLE_CLOUD_PROJECT \
      "--metadata=sysprep-specialize-script-ps1=Add-WindowsFeature RSAT-AD-PowerShell;Add-WindowsFeature RSAT-DNS-Server"
    
  4. 為搜尋伺服器建立兩個 VM 執行個體:

    gcloud compute instances create sp-search-1 \
      --zone=$SUBNET_ZONE_1 \
      --machine-type=n1-standard-8 \
      --boot-disk-size=200 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --tags=sharepoint,sharepoint-search \
      --image=sharepoint \
      --image-project=$GOOGLE_CLOUD_PROJECT
    
    gcloud compute instances create sp-search-2 \
      --zone=$SUBNET_ZONE_2 \
      --machine-type=n1-standard-8 \
      --boot-disk-size=200 \
      --boot-disk-type=pd-ssd \
      --subnet=$SUBNET_NAME \
      --tags=sharepoint,sharepoint-search \
      --image=sharepoint \
      --image-project=$GOOGLE_CLOUD_PROJECT
    
  5. 查看最後一個 VM 的序列埠輸出內容,監控初始化程序:

    gcloud compute instances tail-serial-port-output sp-search-2 --zone=$SUBNET_ZONE_2
    

    等待約 2 分鐘,直到看到輸出內容 Instance setup finished,然後按下 Ctrl+C。此時,VM 執行個體已可供使用。

  6. 針對六個 VM 執行個體,分別執行下列步驟:

    1. 為 VM 執行個體建立使用者名稱和密碼。
    2. 使用遠端桌面連線至 VM,並使用上一個步驟建立的使用者名稱和密碼登入。
    3. 在「Start」(開始) 按鈕上按一下滑鼠右鍵 (或按下 Win+X),然後點選「Windows PowerShell (Admin)」。
    4. 按一下「是」,確認權限提升提示。
    5. 將電腦加入 Active Directory 網域:

      Add-Computer -Domain DOMAIN
      

      將 DOMAIN 替換為 Active Directory 網域的 DNS 名稱。

    6. 重新啟動電腦:

      Restart-Computer
      

      等待約 1 分鐘,讓重新啟動程序完成。

建立 SharePoint 伺服器

現在,您可以使用自訂映像檔,為 SharePoint 伺服器陣列建立 VM 執行個體。

VM 執行個體使用 n1-standard-8 機型。視您打算如何使用 SharePoint 伺服器陣列而定,您可能需要使用較大的機型。請參閱硬體需求,進一步分析您的需求和系統需求:

設定負載平衡

如要讓用戶端使用單一虛擬 IP 位址存取 SharePoint,請使用內部負載平衡器。負載平衡器會在兩個前端伺服器 sp-frontend-1 和 sp-frontend-2 之間分配要求。

如要將兩個前端伺服器與負載平衡器建立關聯,請先建立兩個執行個體群組,然後將這些執行個體群組指派給負載平衡器:

  1. 返回現有的 Cloud Shell 工作階段。
  2. 在每個可用區建立一個非代管執行個體群組:

    gcloud compute instance-groups unmanaged create sp-frontend-1 --zone=$SUBNET_ZONE_1
    
    gcloud compute instance-groups unmanaged create sp-frontend-2 --zone=$SUBNET_ZONE_2
    
  3. 將執行前端伺服器的 VM 執行個體新增至執行個體群組:

    gcloud compute instance-groups unmanaged add-instances sp-frontend-1 \
      --instances sp-frontend-1 \
      --zone=$SUBNET_ZONE_1
    
    gcloud compute instance-groups unmanaged add-instances sp-frontend-2 \
      --instances sp-frontend-2 \
      --zone=$SUBNET_ZONE_2
    
  4. 建立健康狀態檢查,探測 Sharepoint 的 HTTP 路徑:

    gcloud compute health-checks create tcp sp-health-check --port 80
    
  5. 建立負載平衡器後端,並新增兩個執行個體群組:

    gcloud compute backend-services create sp-backend \
      --load-balancing-scheme internal \
      --region=$SUBNET_REGION \
      --health-checks sp-health-check \
      --protocol=tcp
    
    gcloud compute backend-services add-backend sp-backend \
      --instance-group=sp-frontend-1 \
      --instance-group-zone=$SUBNET_ZONE_1 \
      --region=$SUBNET_REGION
    
    gcloud compute backend-services add-backend sp-backend \
      --instance-group=sp-frontend-2 \
      --instance-group-zone=$SUBNET_ZONE_2 \
      --region=$SUBNET_REGION
    
  6. 為負載平衡器保留靜態 IP 位址:\

    gcloud compute addresses create sp-frontend \
      --region=$SUBNET_REGION \
      --subnet=$SUBNET_NAME
    
  7. 為負載平衡器建立轉送規則:

    gcloud compute forwarding-rules create sp-frontend \
      --load-balancing-scheme=internal \
      --ports=80 \
      --network=$VPC_NAME \
      --subnet=$SUBNET_NAME \
      --region=$SUBNET_REGION \
      --address=sp-frontend \
      --backend-service=sp-backend
    
  8. 建立防火牆規則,允許流量從負載平衡器傳送至後端服務:

    gcloud compute firewall-rules create allow-http-health-checks \
      --network=$VPC_NAME --allow tcp:80 \
      --source-ranges=130.211.0.0/22,35.191.0.0/16 \
      --target-tags="sharepoint-frontend"
    

    來源範圍是內部負載平衡器的 IP 範圍。詳情請參閱「設定防火牆規則以允許內部負載平衡」。

  9. 查詢負載平衡器的 IP 位址:

    gcloud compute addresses describe sp-frontend \
      --region=$SUBNET_REGION \
      --format=value\(address\)
    

    部署 SharePoint 伺服器陣列後,您會需要這個 IP 位址。

在 DNS 中註冊負載平衡器

如要允許用戶端使用人類可讀的網址存取 SharePoint,請在 DNS 中為負載平衡器註冊名稱:

  1. 使用遠端桌面連線至 sp-app-1,並以 DnsAdmins 群組成員的身分登入。
  2. 在「開始」按鈕上按一下滑鼠右鍵 (或按下 Win+X 鍵),然後點選「Windows PowerShell」。
  3. 建立記錄,將名稱 sharepoint 對應至負載平衡器的 IP 位址:

    Add-DnsServerResourceRecordA `
      -ComputerName (Get-ADDomainController).Hostname `
      -Name "sharepoint" `
      -ZoneName "DOMAIN" `
      -IPv4Address LOADBALANCER-IP
    

    其中:

    • LOADBALANCER-IP 是負載平衡器的 IP 位址。
    • DOMAIN 是 Active Directory 網域的 DNS 網域。

建立 SharePoint 伺服器陣列

雖然這六部伺服器已安裝所有必要的軟體套件,但尚未加入 SharePoint 伺服器陣列。現在,您要建立伺服器陣列,並指派角色,將伺服器新增至伺服器陣列。

建立伺服器陣列服務帳戶

如要建立 SharePoint 伺服器陣列,您必須建立伺服器陣列服務帳戶。伺服器陣列服務帳戶是 Active Directory 使用者帳戶,用於執行 SharePoint 服務及存取 SQL Server。

如要進一步瞭解伺服器陣列服務帳戶,請參閱「SharePoint Server 中的帳戶權限和安全性設定」。

如要在 Active Directory 中建立伺服器陣列服務帳戶,請按照下列步驟操作:

  1. 返回 sp-app-1 的 PowerShell 提示。
  2. 定義伺服器陣列服務帳戶的密碼:

    $FarmServicePassword = Read-Host -Prompt "Enter password for Farm service account" -AsSecureString
    
  3. 在 Active Directory 中建立伺服器陣列服務帳戶:

    New-ADUser `
      -Name "SharePoint Service" `
      -SamAccountName sp-farm  `
      -UserPrincipalName "sp-farm@$((Get-ADDomain).DNSRoot)" `
      -AccountPassword $FarmServicePassword `
      -PassThru | Enable-ADAccount
    
  4. 為 sp-farm 建立登入資訊,將 SQL Server 的存取權授予伺服器陣列服務帳戶。將登入設定為使用 Windows 驗證,這樣就不必指派新密碼。

設定第一部伺服器

現在,請設定第一部伺服器,建立 SharePoint 伺服器陣列。第一部伺服器很特別,因為它代管中央管理網站。稍後您會使用這個網站設定伺服器陣列。

  1. 返回 sp-app-1 的 RDP 工作階段。
  2. 依序按一下「Start」>「Microsoft SharePoint Products」>「SharePoint Products Configuration Wizard」。
  3. 請按照「建立及設定伺服器陣列」中的步驟操作:
    1. 在「Specify Configuration Database Settings」(指定設定資料庫設定) 頁面中,指定您先前建立的 sp-farm 使用者名稱和密碼。
    2. 在「Specify Server Role」(指定伺服器角色) 頁面中,選取「Application」(應用程式)。
    3. 在「Configure SharePoint Central Administration Web Application」(設定 SharePoint 中央管理網頁應用程式) 頁面中,指定通訊埠 8000。
    4. 設定完成後,瀏覽器視窗會開啟。關閉視窗,並略過其餘步驟。
  4. 依序按一下「Start」(開始) >「Microsoft SharePoint Products」(Microsoft SharePoint 產品) >「SharePoint Management Shell」(SharePoint 管理殼層)。
  5. 套用待處理的 SharePoint 更新:

    PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
    

正在設定其餘伺服器

現在可以將其餘伺服器新增至 SharePoint 伺服器陣列。

VM 執行個體 角色
sp-app-2 應用程式
sp-frontend-1 前端與分散式快取
sp-frontend-2 前端與分散式快取
sp-search-1 搜尋
sp-search-2 搜尋

針對每個 VM 執行下列操作:

  1. 使用遠端桌面連線至 VM,並以網域管理員使用者身分登入。
  2. 依序按一下「Start」>「Microsoft SharePoint Products」>「SharePoint Products Configuration Wizard」。
  3. 在「Welcome to SharePoint Products」頁面,按一下「Next」。
  4. 系統會顯示對話方塊,通知您在設定期間可能需要重新啟動某些服務,請按一下「Yes」(是)。
  5. 在「Connect to a server farm」頁面,選取「Connect to an existing server farm」。
  6. 在「Specify configuration database settings」(指定設定資料庫設定) 頁面,指定您在第一部伺服器使用的資料庫伺服器和資料庫名稱。
  7. 在下一頁輸入先前定義的通關密語。
  8. 在「Specify server role」(指定伺服器角色) 頁面中,選取與 VM 對應的角色,然後按一下「Next」(下一步)。
  9. 在「Completing the SharePoint products configuration wizard」(完成 SharePoint 產品設定精靈) 頁面上,確認設定並按一下「Next」(下一步)。
  10. 在「Configuration Successful」頁面,按一下「Finish」。

  11. 關閉瀏覽器視窗。

  12. 依序按一下「Start」(開始) >「Microsoft SharePoint Products」(Microsoft SharePoint 產品) >「SharePoint Management Shell」(SharePoint 管理殼層)

  13. 套用待處理的 SharePoint 更新:

    PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
    

設定農場

現在,請使用 SharePoint 設定精靈完成伺服器陣列設定:

  1. 使用遠端桌面連線至 sp-app-1。
  2. 依序點選「開始」>「Google Chrome」,開啟 Chrome 瀏覽器。
  3. 前往 http://sp-app-1:8000/configurationwizards.aspx
  4. 以網域管理員使用者身分登入。
  5. 選取「Launch the Farm Configuration Wizard」。
  6. 在「歡迎」頁面,選取「啟動精靈」。
  7. 在「Service Applications and Services」(服務應用程式和服務) 頁面中,按一下「Use existing managed account」(使用現有的受管理帳戶),然後選取 sp-farm 使用者。
  8. 確認要安裝的服務清單,並依需求自訂選項。
  9. 選取「下一步」,開始設定程序。

    整個過程大約需要 10 到 15 分鐘。

  10. 在「Create Site Collection」(建立網站集合) 頁面中,指定標題並選取範本,然後按一下「OK」(確定)。如要進一步瞭解如何建立網站,請參閱「使用中央管理建立網站集合」。

  11. 在「This completes the Farm Configuration Wizard」(伺服器陣列設定精靈已完成) 頁面,選取「Finish」(完成)。

  12. 在「Central Administration」首頁上,依序選取「System Settings」>「Manage servers in farm」。

  13. 確認所有伺服器都標示為「Compliant」,且狀態標示為「No Action Required」。

如要進一步瞭解如何管理 SharePoint 伺服器陣列,請參閱「Managing a MinRole Server Farm in SharePoint Servers 2016 and 2019」(在 SharePoint Server 2016 和 2019 中管理 MinRole 伺服器陣列)

設定替代存取對應

如要允許使用者透過負載平衡器的 DNS 名稱存取 SharePoint 網站,請設定替代存取權對應:

  1. 在「Central Administration」首頁上,依序選取「System Settings」>「Configure alternate access mappings」。
  2. 在「Alternate Access Mapping Collection」旁邊,依序選取「Show All」>「Change alternate access mapping collection」。
  3. 在「Select alternate access mapping collection」對話方塊中,選取「SharePoint - 80」。
  4. 選取「編輯公開網址」。
  5. 設定下列對應:

    1. 預設:

      http://sharepoint.DOMAIN
      

      其中 DOMAIN 是 Active Directory 網域的 DNS 網域。

    2. 清除其他所有欄位。

  6. 按一下「儲存」。

  7. 在「Start」(開始) 按鈕上按一下滑鼠右鍵 (或按下 Win+X),然後點選「Windows PowerShell (Admin)」。

  8. 如要讓替代存取對應生效,請在所有伺服器上重新啟動 IIS:

    "sp-app-1", "sp-app-2", "sp-frontend-1", "sp-frontend-2", "sp-search-1", "sp-search-2" | %  { & iisreset $_ }
    

SharePoint 伺服器陣列現在已可使用。

測試 SharePoint 網站

如要確認您可以使用負載平衡器的 DNS 名稱存取 SharePoint 網站,請按照下列步驟操作:

  1. 在 Chrome 中前往下列網址:

    http://sharepoint.DOMAIN
    

    將 DOMAIN 替換為 Active Directory 網域的 DNS 網域。

  2. 以管理網域使用者身分登入。

    由於這是您第一次開啟網站,因此網站需要幾分鐘的時間才能初始化。

  3. 確認您看到 SharePoint 網站的首頁。

  4. 在「文件」下方,選取「上傳」。

  5. 選取要上傳至網站的測試文件。如果沒有可供測試的文件,可以使用空白的 RTF 格式文件 (.rtf)。

  6. 按一下「確定」即可上傳文件。

SharePoint 會定期檢索文件,更新搜尋索引。如要避免等待檢索,請手動啟動檢索:

  1. 在 sp-app-1 上,依序按一下「Start」(開始) >「Microsoft SharePoint Products」(Microsoft SharePoint 產品) >「SharePoint Management Shell」。
  2. 開始完整檢索:

    $Crawler = (Get-SPEnterpriseSearchServiceApplication |Get-SPEnterpriseSearchCrawlContentSource)
    $Crawler.StartFullCrawl()
    

等待約 5 分鐘,讓檢索程序在背景完成。

現在可以搜尋先前上傳的文件,驗證 SharePoint 搜尋功能是否正常運作:

  1. 返回 Chrome 和 SharePoint 網站。
  2. 使用搜尋框,搜尋您上傳的檔案名稱。
  3. 確認檔案顯示在搜尋結果中。

清除所用資源

如要避免在完成本教學課程後繼續產生費用,請刪除您已建立的實體。

刪除 Google Cloud 專案

  1. 前往 Google Cloud 控制台的「Manage resources」(管理資源) 頁面。

    前往「Manage resources」(管理資源)

  2. 在專案清單中選取要刪除的專案,然後點選「Delete」(刪除)。
  3. 在對話方塊中輸入專案 ID,然後按一下 [Shut down] (關閉) 以刪除專案。

後續步驟