限制数据未发布到所有活动节点

时间:2018-05-17 11:11:12

标签: wso2 wso2-am throttling

我有api manager的两个物理节点,如本指南中所述配置。负载平衡器后面的一个机器箱中的两个所有组件。

https://docs.wso2.com/display/AM220/Configuring+an+Active-Active+Deployment#ConfiguringanActive-ActiveDeployment-Step4-ConfigurethePublisherwiththeGateway

以下是api-manager.xml中数据发布者的配置

 <DataPublisher>
            <Enabled>true</Enabled>
            <ReceiverUrlGroup>{tcp://172.31.31.93:9611},{tcp://172.31.16.52:9611} </ReceiverUrlGroup>
            <AuthUrlGroup>{ssl://172.31.31.93:9711},{ssl://172.31.16.52:9711}</AuthUrlGroup>
            <DataPublisherPool>
                <MaxIdle>1000</MaxIdle>
                <InitIdleCapacity>200</InitIdleCapacity>
            </DataPublisherPool>
            <DataPublisherThreadPool>
                <CorePoolSize>200</CorePoolSize>
                <MaxmimumPoolSize>1000</MaxmimumPoolSize>
                <KeepAliveTime>200</KeepAliveTime>
            </DataPublisherThreadPool>

我已经使用每分钟10个请求的应用程序限制策略设置了一个应用程序。当我将两个实例放在负载均衡器后面并且发出请求时,只要两个节点都启动,我就可以每分钟发出20个请求。但是,如果我将一个节点关闭,它允许我每分钟发出10个请求。我怀疑网关没有将流量数据发布到流量管理器。

我需要检查哪些配置错过才能启用?在我的情况下,唯一偏离指定配置的是我不指向两个发布者的单个网关节点。因此,两个节点都在api-manager.xml中具有以下APIGateway配置

<APIGateway>
        <!-- The environments to which an API will be published -->
        <Environments>
            <!-- Environments can be of different types. Allowed values are 'hybrid', 'production' and 'sandbox'.
                 An API deployed on a 'production' type gateway will only support production keys
                 An API deployed on a 'sandbox' type gateway will only support sandbox keys
                 An API deployed on a 'hybrid' type gateway will support both production and sandbox keys. -->
            <!-- api-console element specifies whether the environment should be listed in API Console or not -->
            <Environment type="hybrid" api-console="true">
                <Name>Production and Sandbox</Name>
                <Description>This is a hybrid gateway that handles both production and sandbox token traffic.</Description>
                <!-- Server URL of the API gateway -->
                <ServerURL>https://localhost:${mgt.transport.https.port}${carbon.context}services/</ServerURL>
                <!-- Admin username for the API gateway. -->
                <Username>${admin.username}</Username>
                <!-- Admin password for the API gateway.-->
                <Password>${admin.password}</Password>
                <!-- Endpoint URLs for the APIs hosted in this API gateway.-->
                <GatewayEndpoint>http://${carbon.local.ip}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port}</GatewayEndpoint>
            </Environment>
        </Environments>
    </APIGateway>

任何帮助将不胜感激。我的目标是确保无论请求被重定向到哪个网关节点,限制都应该与跨节点的订阅中定义的一致。

目前,似乎每个节点都进行了单独的限制。

0 个答案:

没有答案