在負載均衡環境中實現遠端事件

如果 Sitecore 是在 CM-CD 環境中設定的,則可能需要在 CM 事件觸發時在 CD 伺服器上觸發事件。

當內容編輯器在 CM 上釋出時,該示例可能是在 CD 上釋出 publish:end:remote。

為了確保觸發事件,需要執行以下步驟:

  1. 檢查 web.config 中是否啟用了事件佇列
    <!--  ENABLE EVENT QUEUES
            If enabled, Sitecore sends local events to the event queue available to remote instances,
            and handles events in the queue from remote instances.
            Default value: true
      -->
      <setting name="EnableEventQueues" value="true" />
  1. 將 ScalabilitySettings.config 新增到每個例項。將每個伺服器的 InstanceName 和 PublishingInstance 設定為 CM 伺服器例項名稱。

可以在 App_Config / Include 資料夾中找到 ScalabilitySettings.config 的示例。

<!--  INSTANCE NAME
            Unique name for Sitecore instance.
            Default value: (machine name and IIS site name)
      -->
      <setting name="InstanceName">
        <patch:attribute name="value">BAYERUATCD</patch:attribute>
      </setting>
      <!--  PUBLISHING INSTANCE
            Assigns the instance name of dedicated Sitecore installation for publishing operations.
            When empty, all publishing operations are performed on the local installation of Sitecore.
            Default vaue: (empty)
      -->
      <setting name="Publishing.PublishingInstance">
        <patch:attribute name="value">BAYERUATCM</patch:attribute>
      </setting>
      <!--  COUNTERS INSTANCE NAME
            Instance name for performance counters.
            Default value: (value of InstanceName setting)
      -->
      <setting name="Counters.InstanceName">
        <patch:attribute name="value">BAYERUATCD</patch:attribute>
      </setting>
      <!--  SECURITY CACHE EXPIRATION
            Sets the absolute expiration on the cached security data.
            A value of 00:00:00 disables automatic expiration of security caches.

      -->