上一主题: 配置对收集器的代理分配下一主题: 配置代理-企业管理器网络拓扑


代理负载平衡配置示例

您可以通过各种方法配置 MOM 代理负载平衡属性。 这些配置示例提供了代码示例:

将代理分配给特定的收集器或收集器组

以下示例显示了如何配置将名为 MyAgent 的代理分配给端口 5001 上名为“myhost”的收集器。

<agent-collector name="Assign MyAgent to One Collector Example">
<agent-specifier>.*\|.*\|MyAgent</agent-specifier>
<include>
<collector host="myhost" port="5001"/>
</include>
</agent-collector>

以下示例显示了如何配置 latched 属性,其中:

以下示例显示了如何分配代理,其中:

以下示例显示了如何分配代理,其中:

将代理排除在特定收集器或收集器组外

以下示例显示了如何从名为 MyHost 的收集器排除名为 MyAgent 的代理。

<agent-collector name="Exclude MyAgent from a Collector Example">
<agent-specifier>.*\|.*\|MyAgent</agent-specifier>
<exclude>
<collector host="MyHost" port="5001"/>
</exclude>
</agent-collector>

以下示例显示了如何从多个收集器排除多个代理。

<agent-collector name="Exclude Two Agents Assigned from Two Collectors Example>
<agent-specifier>.*\|.*\|MyAgent.*</agent-specifier>
<agent-specifier>.*\|.*\|MyOtherAgent.*</agent-specifier>
<exclude>
<collector host="MyHost" port="5001"/>
<collector host="MyOtherHost" port="5001"/>
</exclude>
</agent-collector>

将多个代理分配给多个收集器

以下示例显示了如何将多个代理分配给多个收集器。

<agent-collector name="Two Agents Assigned to Two Collectors Example>
<agent-specifier>.*\|.*\|MyAgent.*</agent-specifier>
<agent-specifier>.*\|.*\|MyOtherAgent.*</agent-specifier>
<include>
<collector host="MyHost" port="5001"/>
<collector host="MyOtherHost" port="5001"/>
</include>
</agent-collector>

将代理分配给同一群集中的特定收集器

下列示例显示了如何将名为 EPAgent 的代理分配给群集中的收集器,其中:

注意,要将代理分配给 host1 和 host2,MOM 会使用默认通信信道端口,且 loadbalancing.xml 也有此要求。

<agent-collector name="Allow EPAgents on Two Collectors in the Same Cluster Example">

<agent-specifier>.*\|.*\|EPAgent.*</agent-specifier>
<include>
<collector host="host01" port="5001"/>
<collector host="host02" port="5001"/>
</include>
</agent-collector>

将代理分配给不同群集中的特定收集器

下列示例显示了如何将名为 EPAgent 的代理分配给不同群集中的收集器,其中:

注意,要将代理分配给 host1 和 host2,MOM 会使用企业管理器通信信道端口的特定 EPAgent,且 loadbalancing.xml 也有此要求。

下列示例显示出,在代理使用直接套接字连接连接到收集器时,如何将 EPAgent 分配给在不同群集的收集器。

<agent-collector name="Allow EPAgents on Two Collectors in Different Clusters - Direct Socket Connection Example">
<agent-specifier>.*\|.*\|EPAgent.*</agent-specifier>
<include>
<collector host="host01" port="5001"/>
<collector host="host02" port="5001"/>
</include>
</agent-collector>

下列示例显示出,在代理使用 HTTP 连接到收集器时,如何将 EPAgent 分配给在不同群集的收集器。

<agent-collector name="Allow EPAgents on Two Collectors in Different Clusters - HTTP Example">
<agent-specifier>.*\|.*\|EPAgent.*</agent-specifier>
<include>
<collector host="host01" port="8081"/>
<collector host="host02" port="8081"/>
</include>
</agent-collector>

下列示例显示出,在代理使用 HTTPS 连接到收集器时,如何将 EPAgent 分配给在不同群集的收集器。

<agent-collector name="Allow EPAgents on Two Collectors in Different Clusters - HTTPS Example">
<agent-specifier>.*\|.*\|EPAgent.*</agent-specifier>
<include>
<collector host="host01" port="8444"/>
<collector host="host02" port="8444"/>
</include>
</agent-collector>

下列示例显示出,在代理使用 SSL 连接到收集器时,如何将 EPAgent 分配给在不同群集的收集器。

<agent-collector name="Allow EPAgents on Two Collectors in Different Clusters - SSL Example">
<agent-specifier>.*\|.*\|EPAgent.*</agent-specifier>
<include>
<collector host="host01" port="5443"/>
<collector host="host02" port="5443"/>
</include>
</agent-collector>