WSO2Con 2013 CFP Banner

How to install WSO2 Carbon cluster management feature?

Discuss this article on Stack Overflow
By Charitha Kankanamge
  • 22 Dec, 2009
  • Level:  Introductory
  • Reads: 6008

Charitha Kankanamge - WSO2 Technical lead/Manager for Quality Assurance guides you through the steps to install and configure cluster management feature in WSO2 Application Server.

Charitha Kankanamge
Senior Manager, Support
WSO2 Inc

Abstract

High availability and scalability are some of the major requirements expected from any enterprise-grade server product. WSO2 Carbon provides support for clustering hence you can achieve the advantage of mainitaining minimum down time of your servers as well as improving performance. In a clustered server setup, it is extremely important to group a set of nodes and manage them through a single point so that the maintainability is high and efficient. WSO2 Carbon cluster management feature is designed to provides users with these capabilities. It allows users to manage a cluster of WSO2 Carbon servers from a single host. This tutorial guides you through the steps to install and configure cluster management feature in WSO2 Application Server which is a member of WSO2 Carbon family of products.

Applies To

WSO2 Application Server 3.1.0 or later

 

Table of Contents

  • Setting up WSO2 Application Server cluster
  • Installing Cluster management feature
  • Managing Cluster

 

Introduction

Cluster management feature is not included by default in any of the WSO2 Carbon based products. Users are supposed to install it as an Equinox P2 feature in the nodes of a cluster. In this tutorial, we start from setting up a WSO2 Application Server cluster with 3 nodes placed in 2 node groups (application domains). Then, we install cluster management feature group in one node designated as Cluster Manager. We also install cluster management core feature group on two member nodes. Next, we will see how the node groups can be managed using cluster manager UI.

Setting up WSO2 Application Server cluster

Download the latest version of WSO2 Application Server from here. Create three directories called group-manager, group1 and group2. Copy the downloaded wso2wsas-3.X.zip in to those three directories and unzip each of them. Name these distributions appropriately as given below.

Since we are going to run these three instances in a single host we should specify different HTTP and HTTPS ports in all nodes. You could update the ports by setting ports offset value in repository/conf/carbon.xml files of each of the above directories as follows.

Edit cluster-manager/wso2as-4.1.2-CM/repository/conf/carbon.xml

<Offset>1</Offset>

Edit group1/wso2as-4.1.2-node1/repository/conf/carbon.xml

<Offset>2</Offset>

Edit group2/wso2as-4.1.2-node2/repository/conf/carbon.xml

<Offset>3</Offset>

Now, we need to enable clustering in each of these nodes. In order to configure clustering we must update the axis2.xml files of each of the nodes appropriately. Lets update the cluster manager node first.

Cluster Manager

Open cluster-manager/wso2as-4.1.2-CM/repository/conf/axis2.xml and locate clustering element and set enable attribute value to true.

<clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">

Specify a domain name for the cluster manager node.

<parameter name="domain">CMGroup</parameter>

If the node is designated as cluster manager, then the groupManagement element needs to be enabled. Since we manage two node groups, we need to specify them as given below.

<groupManagement enable="true">
<applicationDomain name="group1"
description="WSAS Group 1"
agent="org.apache.axis2.clustering.management.DefaultGroupManagementAgent"/>
<applicationDomain name="group2"
description="WSAS Group 2"
agent="org.apache.axis2.clustering.management.DefaultGroupManagementAgent"/>

</groupManagement>

We have configured the necessary files in cluster manager node. Lets update the axis2.xmls of two member nodes.

group1/wso2as-4.1.2-node1

First, enable clustering for this node.

<clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">

Specify a domain name for this node. Make sure to specify the same applicationDomain name given in the above cluster manager configuration.

<parameter name="domain">group1</parameter>

group2/wso2as-4.1.2-node2

First, enable clustering for this node.

<clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">

Specify a domain name for this node. Make sure to specify the same applicationDomain name given in the above cluster manager configuration.

<parameter name="domain">group2</parameter>

Now we have performed the necessary configurations and set up a WSO2 Web Services Application Server cluster. Start each of the servers.

sh wso2server.sh

Installing Cluster management feature

As I had stated before, cluster management feature is not included by default in WSO2 Application Server. Therefore, we must install it as a P2 feature using a valid P2 repository. Lets install cluster management feature in cluster-manager/wso2as-4.1.2-CM node.

If the server is not started in wso2as-4.1.2-CM, start the server first. Log in to management console with the default username and password (admin/admin).

Select Configure --> Features in the left menu. You will be directed to the following screen.

Click on Add Repository and add a P2 repository to install the feature. Specify http://dist.wso2.org/p2/carbon/releases/3.2.2/ as the P2 repo URL. You can find the P2 repo url associated with any version of WSO2 Application Server from http://wso2.org/downloads/appserver/ page

After adding the P2 repository, click on Find Features. You will notice the Cluster Management feature in the search results.

Select the feature and install the component. You should see a confirmation message informing the completion of installation. Restart the server in order for the changes to get affected.

As you installed cluster management feature group in the cluster manager node, we should install the same feature in the member nodes of the cluster. 

Managing Cluster

We have configured WSO2 Application Server cluster with 2 node groups and a cluster manager instance. Now we are going to look at the cluster management capabilities provided by WSO2 Carbon by accessing the management console of cluster manager instance. Access the management console of cluster-manager/wso2as-4.1.2-CM. You will notice the Cluster menu option under the Manage in the left navigation pane. Click on it and you will be directed to Cluster Groups page as follows.

Using this page, you can restart or shutdown the whole cluster.

Click on group1 link in the above page. Members of Group group1 page will be displayed as follows.

You can access the management consoles of each of the members of a group using this page. Also, you can shutdown or restart the selected node group. Also, You can switch the selected group to maintenance mode so that each member stops servicing requests.

Summary

In this tutorial, we looked in to the steps to configure and set up a WSO2 Application Server cluster, installing WSO2 Carbon cluster management feature group and administering the cluster using a single cluster management agent instance. Though the steps have been discussed using WSO2 Application Server, the same instructions are applicable for all of the WSO2 Carbon family of products (WSO2 Enterprise Service Bus, WSO2 Business Process Server, WSO2 Mashup Server, WSO2 Governance Registry, WSO2 Identity Server, WSO2 Data Services Server).

 

References

[1]http://wso2.org/library/articles/introduction-wso2-carbon-clustering

[2]http://wso2.org/library/articles/wso2-carbon-cluster-configuration-language 

 

Author

Charitha Kankanamge, Technical lead/Manager for Quality Assurance, WSO2, charitha AT wso2 DOT com

 

AttachmentSize
fm1.png131.73 KB