在负载均衡环境中实现远程事件

如果 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.

      -->