Social Icons

twitterfacebookgoogle pluslinkedinrss feed

Wednesday, February 20, 2013

How to configure WSO2 G-Reg with ELB

When we front WSO2 ELB(Elastic Load Balancer) into WSO2 G-Reg(Governance Registry) node, all the incoming messages will go through ELB node and it will act as a HTTP and HTTPS proxy to GREG node. So when you configure ELB to the GREG front, GREG won't be able to access alone without the ELB.

 1. Download WSO2 ELB and WSO2 GREG. Rename the extracted ELB as ELB-HOME and extracted GREG as GREG-HOME.

ELB Configuration 


 2. Go to ELB-HOME/repository/conf/loadbalancer.conf and add the following entry. There can be multiple entries according to the clustering requirements.
 governance {
                domains {

                        wso2.governance.domain {
                                min_app_instances       1;
                                hosts           governance.local.wso2.com;
                                sub_domain      mgt;
                                tenant_range    *;
                        }
                }
        }

3. Update hosts files in nodes with relevant IP and Domain information. In my example, G-Reg and ELB will be hosted in same node.

 127.0.0.1 governance.local.wso2.com
if not this governance.local.wso2.com should be mapped in to ELB node.

Greg Configuration 


4. Uncomment
 <localmemberhost></localmemberhost>
element in GREG-HOME/repository/conf/axis2/axis2.xml and specify the IP address (or host name) to be exposed to members of the cluster.

 <parameter name="localMemberHost">127.0.0.1</parameter>

5. Then clustering should be enable in G-Reg also. To enable it, go to GREG-HOME/repository/conf/axis2/axis2.xml and modify clustering configuration as below.
  <clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">
  <parameter name="membershipScheme">wka </parameter>

  </clustering>
6. Then define clustering domain information.(in GREG-HOME/repository/conf/axis2/axis2.xml). This "domain" and "localMemberHost" information should be same as loadbalancer.conf.

<parameter name="domain">wso2.governance.domain</parameter>
 <parameter name="localMemberHost">governance.local.wso2.com</parameter>
 <parameter name="localMemberPort">4250</parameter>

7. As shown below, add "subDomain" information in to the same axis2.xml file.
 <parameter name="properties">
     <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
     <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
     <property name="subDomain" value="mgt"/>
    </parameter>
8. Add load balancer IP address or host information in to same axis2.xml file. In this example scenario IP address is 127.0.0.1.

     <member>
        <hostname>127.0.0.1 </hostname>
        <port>4000</port>
     </member>
  </members>
9. Open the GREG-HOME/repository/conf/tomcat/catalina-server.xml file and add HTTP and HTTPS proxy port information to that file.
 <connector port="9763" protocol="org.apache.coyote.http11.Http11NioProtocol" proxyport="8280"/>
 
 <connector port="9443" protocol="org.apache.coyote.http11.Http11NioProtocol" proxyport="8243"/>

10. Go to GREG-HOME/repository/conf/carbon.xml file and update the "HostName" and "MgtHostName" as below.

<hostname>governance.local.wso2.com</hostname>
 <mgthostname>governance.local.wso2.com</mgthostname>

11. This step only need to be followed if you are hosting G-Reg and ELB both in same node. In this sample we have configured both ELB and G-Reg in same node. Therefore we should avoid port conflict between ELB and G-Reg. To avoid such problems we can use "Offset" entry in carbon.xml file. Go to GREG-HOME/repository/conf/carbon.xml and change port offset value.

<offset>1</offset>

12. Start the ELB instance

13. Start the G-Reg instance(s)

14.You can access G-Reg instance using following URL "https://governance.local.wso2.com:8243/carbon/"
Post a Comment