Monday, July 21, 2014

Accessing the API Manager Gateway using the WSO2 ELB

Every day I'm setting up the WSO2 API manager in different configurations.  Some issues seem to come up time and again.  This post is about a simple one:  using the proper host names to connect to the Gateway nodes through the WSO2 Elastic Load Balancer.

When setting up the loadbalancer.conf file in <ELB_HOME>/repository/conf , you set host names for the worker and manager clusters:

  esb {
        # multiple hosts should be separated by a comma.
    #url_suffix         esb.wso2.com;
        domains   {
            wso2.esb.domain {
                tenant_range    *;
        group_mgt_port 4500;
        worker {
            hosts esb.wso2.com;
        }
        mgt {
            hosts mgt.esb.wso2.com;
        }
            }
        }
    }

At first, I thought that these host names were internal to the application, and would only be used in the API node setup.  But they aren't!  The domain name is used in the worker/manager cluster configuration, but the host names are not.  Instead, the host names are for external use only.  They are the method through which traffic is directed to the correct group (worker or mgt).

If you have trouble connecting to a worker or manager through an ELB, check that the host name you're using matches exactly one of the hosts defined in the ELB.  Otherwise, you may get a confusing error:

ERROR - DynamicLoadbalanceEndpoint application member not available

This doesn't always mean that the worker member isn't connected to the ELB (although that can happen).  In some cases, it can mean that you tried connecting to the ELB using a host name (or IP, or local host) that wasn't explicitly assigned in loadbalancer.conf.

Cheers, y'all!

No comments:

Post a Comment