如何配置WSO2 API Manager网关和密钥管理器群集设置?

时间:2014-01-20 20:53:11

标签: wso2 cluster-computing gateway

我正在使用以下架构实现WSO2 API Manager: 单个发布者/商店节点。 两个服务器运行网关和密钥管理器的2节点集群。

当我关注时:http://docs.wso2.org/display/CLUSTER420/Clustering+API+Manager#ClusteringAPIManager-Configuringcomponentfeatures

然后我进入api-manager.xml的“为组件配置连接”的步骤 配置网关时我很困惑:

   <APIKeyManager>
     <ServerURL>https://keymanager.apim-wso2.com:9444/services/</ServerURL>        
     <Username>admin</Username>  
     <Password>admin</Password>   
     ...
   </APIKeyManager> 

API Key Manager的每个网关/密钥管理器节点是否指向自身?

此外,当我为authmanager和AP​​IGateway配置api-manager.xml时,我的发布服务器和存储库位于不同的服务器上,是否指向群集名称? 配置时:

   <AuthManager>
       <ServerURL>https://keymanager.apim-wso2.com:9444/services/</ServerURL>      
       <Username>admin</Username>
       <Password>admin</Password>
   </AuthManager> 
   <APIGateway>  
     <Environments>
        <Environment type="hybrid">
          <ServerURL>https://gwmanager.apim-wso2.com:9445/services/</ServerURL>         
          <Username>admin</Username>
          <Password>admin</Password> 
          <GatewayEndpoint>http://gwmanager.apim-wso2.com:8282,https://gwmanager.apim-         
             wso2.com:8245</GatewayEndpoint>
        </Environment>
      </Environments>
    </APIGateway> 

3 个答案:

答案 0 :(得分:3)

在回答你的问题之前,让我解释一下他们如何指出。

  1. 配置网关时,需要指定keymanager。

  2. 配置商店时,您需要同时指定keymanager和gateway。

  3. 配置发布者时,需要指定网关。(在1.4.0发布者之前也需要密钥管理器)

  4. 由于网关获取访问API的请求,因此需要首先验证这些请求,因此必须对这些请求进行身份验证。因此网关应该知道密钥管理器的端点。

    另一方面,在创建新API时需要触发关于它们的网关,因此发布者需要知道第3个网关的端点。

    类似地,商店需要关于Keymanager和网关。

    “配置组件之间的连接”

    中给出的图表也说明了这一点

    假设(根据[1])网关+密钥管理器位于部署的同一节点中,网关+密钥管理器节点中的yes元素应配置为指向自身。

    例如,

    <APIKeyManager> 
      <ServerURL>https://gateway-plus-keymanager.apim-wso2.com:9444/services/</ServerURL>
      <Username>admin</Username>
      <Password>admin</Password>
      ...
    </APIKeyManager>
    

    同样,如果你有商店+发布商节点

    <APIKeyManager> 
      <ServerURL>https://gateway-plus-keymanager.apim-wso2.com:9444/services/</ServerURL>
      <Username>admin</Username>
      <Password>admin</Password>
      ...
    </APIKeyManager>
    
    <AuthManager>
        <ServerURL>https://gateway-plus-keymanager.apim-wso2.com:9444/services/</ServerURL>
        <Username>admin</Username>
        <Password>admin</Password>
    </AuthManager>
    
    <APIGateway>
      <Environments>
        <Environment type="hybrid">
            <ServerURL>https://gateway-plus-keymanager.apim-wso2.com:9444/services/</ServerURL>
            <Username>admin</Username>
            <Password>admin</Password>          
            <GatewayEndpoint>http://gateway-plus-keymanager.apim-wso2.com:8281,https://gateway-plus-keymanager.apim-wso2.com:8244</GatewayEndpoint>
        </Environment>
      </Environments>    
    </APIGateway>
    

    请注意,节点网关+ keymanager节点的主机名为gateway-plus-keymanager.apim-wso2.com,并使用端口偏移量1启动服务器。

    [1] How do I configure WSO2 API Manager Gateway and Key Manager Cluster settings?

答案 1 :(得分:1)

如果您使用的是DNS循环,则serverURL应指向https://gateway-plus-keymanager.apim-wso2.com:9444/services/,并且您的DNS应配置为具有两个GW / KM服务器的IP

答案 2 :(得分:0)

您好我相信您在部署体系结构中存在问题。如果您没有使用负载均衡器(LB)进行前端,则没有必要拥有两个网关(GW)节点。因此,您的GW / KM 2节点应该使用负载均衡器。您在GW节点中指向的KM URL实际上应该指向可以在两个KM节点之间分配流量的(LB)。

相关问题