-1

I am trying to configure the Gateway clustering(1 manager , 2 worker with Nginx).

Gateway clustering guide gave me lots of help, but not enough actually. Some part of documents made me confused, so I'm not sure if It's heading for right way for the goal. Please check my configuration with below overview picture.

Overview image link

Nginx https.conf setting

upstream wso2.am.com {
    sticky cookie JSESSIONID;
    server xxx.xxx.xxx.22:9443;     <!-- worker node 1 -->
    server xxx.xxx.xxx.33:9443;     <!-- worker node 2 -->
}

server {
    listen 443;
    server_name nginx.wso2.com;
    location / {
    ...
    proxy_pass http://wso2.am.com;
  }
}

* Store, Publisher, Keymanager setting

each api-manager.xml file (/repository/conf/)

<APIGateway>
    ...
    <ServerURL>https://xxx.xxx.xxx.x11:9444/services/</ServerURL>
    ...
    <!-- Does this endpoint work? I received nothing through this setting -->
    <GatewayEndpoint>http://nginx.wso2.com, https://nginx.wso2.com</GatewayEndpoint>
    ...

Gateway manager node setting

Especially, these below and setting is the most confusing.

carbon.xml file (/repository/conf/)

    <HostName>???</HostName>       <!-- should be nginx host? worker host?-->
    <MgtHostName>???</MgtHostName> <!-- should be nginx host? or manager node? -->

Gateway worker nodes setting

carbon.xml file (/repository/conf/)

    <HostName>???</HostName>        <!-- should be nginx host? or worker node? -->
    <MgtHostName>???</MgtHostName>  <!-- should be nginx host? or manager node? -->

Any comments will be helpful for me.

Thanks , Regards

ironrainbow
  • 141
  • 9

1 Answers1

0

Pattern looks good. I would propose having separate host machines for Key manager, Gateway Manager, Publisher, and Store in a production environment. However, even though you have several components in the same machine, you should keep separate hostnames for separate components. Choose them as you preference.

E.g.

  • Publisher wso2.publisher-apim.com
  • Store wso2.store-am.com
  • Gateway Manager wso2.mgt-am.com
  • Gateway Workers wso2.am.com
  • Key Manager wso2.km-am.com

Then you need to configure Nginx according to that(Map worker node ips to wso2.am.com as per above definition).

Regarding the host name and mgt host name of Management node, the document you should refer is this. E.g. according to above definitions,

<HostName>wso2.am.com</HostName>     
<MgtHostName>wso2.mgt-am.com</MgtHostName>

Regarding the host name and mgt host name of Worker node, the document you should refer is this. E.g. according to above definitions,

<HostName>wso2.am.com</HostName>     

Don't uncomment MgtHostName node.

Also map the hostnames to IPs as instructed here and here. This hostname mapping is done in /etc/hosts file, and only required when a DNS service is not available.