3

I have a plan to use WSO2 API manager for my company, so trying to make it work clustering.

it consists of Keymanager, Gateway(manager, worker), Publisher, Store on 2 AWS instances.

Host1 contains Keymanager, Gateway manager, Publisher, Store. Host2 contains Gateway worker.

the point that I'm confusing is how to configure correct setting for in the /repository/conf/api-manager.xml file.

Case 1) set gateway.manager.com in GatewayEndpoint

<APIGateway>
  . . . 
    <ServerURL>https://gateway.manager.com:9444/services/</ServerURL>
    <Username>admin</Username>
    <Password>admin</Password>
    <GatewayEndpoint>http://gateway.manager.com:8281, https://gateway.manager.com:8244</GatewayEndpoint>
. . .
</APIGateway>

Case 2) set gateway.worker.com in GatewayEndpoint

<APIGateway>
  . . . 
    <ServerURL>https://gateway.manager.com:9444/services/</ServerURL>
    <Username>admin</Username>
    <Password>admin</Password>
    <GatewayEndpoint>http://gateway.worker.com:8280, https://gateway.worker.com:8243</GatewayEndpoint>
. . .
 </APIGateway>

hosts 200.100.100.123 gateway.manager.com 200.100.100.234 gateway.worker.com


Thanks, Regards

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
ironrainbow
  • 141
  • 9

2 Answers2

2

You don't need to APIGateway configuration on Gateway Manager, since you are using Gateway Manager, Key Manager, Publisher, Store in one node.

You can configure you Gateway Manager node as below

<APIGateway>
    <Environments>
        <Environment type="hybrid">
        ...
            <ServerURL>https://gateway.manager.com:9443/services/</ServerURL> <!-- To deploy API to gateway Manager -->
            <Username>admin</Username>
            <Password>admin</Password> 
            <GatewayEndpoint>http://gateway.worker.com:8280,https://gateway.worker.com:8243</GatewayEndpoint> <!-- To show the gateway worker URLs for API in API Store -->
        </Environment>
    </Environments> 
    ...
</APIGateway>

You don't need to configure anything on Gateway Worker Node.

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
  • Thx your reply. for the first time when I modified "api-manager.xml", I thought GatewayEndpoint was just URL like you commented, however API Console test worked well in case Case1, didn't worked in case Case2. it makes me crazy... – ironrainbow Aug 10 '16 at 12:38
1

You dont need to define gateway manager URL in gateway endpoints section. Gateway endpoints section will be used at API store to list API gateway URLs when you click on API and see details. So you can use following configurations for all nodes without any issue.

<GatewayEndpoint>http://gateway.worker.com:8280, https://gateway.worker.com:8243</GatewayEndpoint>

You need to define gateway server URL as follows in publisher mainly because it will use this URL to publish API to gateway manager.

<ServerURL>https://gateway.manager.com:9444/services/</ServerURL>
sanjeewa.190
  • 360
  • 2
  • 8
  • thx for your quick reply, but there is an issue. When I set Case 2 for GatewayEndpoint, API console test in API Store return error code. ( no content , no response from server ). When I set Case1 for GatewayEndpoint, API console test in API Store works well ( it returns response code 200 with correct values). in case Case1, I am not sure if worker node is working. so I thought GatewayEndpoint is the most important point during configring. – ironrainbow Aug 10 '16 at 12:32
  • Before you use API console please try to paste gateway worker pass through transport URL (https://gateway.worker.com:8243) in your browser and let browser to handle client certificate exchange. Or you can paste API invocation URL in browser and hit enter one time. Then you will be able to access API using API console. – sanjeewa.190 Aug 10 '16 at 12:37
  • thanks, I got this problem fixed. Gateway worker nodes return correct response. – ironrainbow Aug 15 '16 at 13:22
  • Glad to hear that. Thanks – sanjeewa.190 Aug 15 '16 at 13:41