Wednesday, December 9, 2009

How To start WSO2 AMI instances from command line

Introduction

WSO2 now their all SOA products exposed in to the cloud computing technology.As a reducing cost and improving flexibility as well as a stability WSO2 SOA products now available as a private and public cloud deployments.Currently WSO2 cloud products support "Amazon EC2" as a public cloud platform and VMware,Linux KVM as a private cloud platform.In this tutorial i am going to explain how you setup and operate WSO2 EC2 cloud products within a few minutes.These are the steps need to be taken for operate WSO2 AMI instances from your command line.

Setup JDK

As a prerequisites you have to setup JDK in your machine.

Step 1 : Download JDK .

Step 2: Install JDK and set JAVA_HOME environment variable.

If you are in Linux open a terminal or .bashrc and insert JAVA_HOME,

Syntax -

  export JAVA_HOME=JDK file path 

Example -

   export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15    

If you are in Windows set JAVA_HOME as a enviroment variable.

Syntax -

   set JAVA_HOME=JDK file path    

Example -

   set JAVA_HOME=c:\\chamara\JDK1.6    

Step 3: Open a terminal/command prompt and type "java -version". if you are configured JAVA_HOME correctly you will see the output like this.

java

Getting Private Key Files from Amazon

Step 4: Now you need amazon EC2 account for operate amazon instances.to create your own amazon account and follow the steps given there to create account.

Step 5: Once you create amazon account you will get couple of PEM-endosed x509 certificate and private key files as

cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem (A PEM encoded signed X.509 certificate)

pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem (An unencrypted, PEM encoded RSA private key that corresponds to the X.509 certificate above)

Step 6: Now download that .pem files.

Setup Amazon API Tools

Amazon API Tools package serves as the client interface of the amazon EC2 web services.to control our web servics we are using this interface.Following steps need to be follow for setup Amazon API Tools package.

Step 7: download Amazon-API tools package.

Step 8: Create a folder called "ami" in your machine,copy that "ec2-api-tools.zip" and extract it.

Step 9: Set "EC2_HOME"environment variable by locating ec2-api-tools folder.

If you are in Linux open a terminal or .bashrc and insert EC2_HOME,

Syntax -

   export EC2_HOME=directorypath/ami/ec2-api-tools 

Example -

   export EC2_HOME=/home/chamara/ami/ec2-api-tools>   

If you are in Windows set EC2_HOME as a enviroment variable.

Syntax -

   set EC2_HOME=folderpath/ami/ec2-api-tools   

Example -

   set EC2_HOME=c://chamara/ami/ec2-api-tools

Step 10: now add ec2-api-tools/bin folder path to your path variable.(See screenshot above)

Step 11: Then create folder called ".ec2" and copy cert and PK .pem files in to that.(earlier we downloaded that)

Step 12: Now you have to create couple of invirenment variables by locating .pem files.

If you are in Linux open a terminal or .bashrc and insert EC2_PRIVATE_KEY & EC2_CERT,

Syntax -

   export EC2_PRIVATE_KEY=folderpath/.ec2/pk-********.pem
export EC2_CERT=folderpath/.ec2/cert-*******.pem

Example -

   export EC2_PRIVATE_KEY=/home/chamara/.ec2/pk-********.pem 
export EC2_CERT=/home/chamara/.ec2/cert-*******.pem

If you are in Windows set EC2_PRIVATE_KEY & EC2_CERT as a enviroment variables.

Syntax -

   set EC2_PRIVATE_KEY=folderpath/.ec2/pk-********.pem
set EC2_CERT=folderpath/.ec2/cert-*******.pem

Example -

   set EC2_PRIVATE_KEY=c//chamara/.ec2/pk-********.pem
set EC2_CERT=c://chamara/.ec2/cert-*******.pem

Step 13: Now you have completed 95% of the confugarions.to check this open terminal or command prompt traverce to .ec2 folder and type "ec2-describe-images".you will see all the available AMI images in your terminal if you are configured successfuly.

Creating Keypair

Step 14: Now you have to create or own key pair.to create that key pair in command prompt/terminal goto the .ec2 folder and type "ec2-add-keypair yourname-keypair"

Example

   chamara@chamara-laptop:~$ ec2-add-keypair chamara-keypair

now you can see your private key in your terminal.

Step 15: Then create a file called "id_rsa-yourname-keypair" in ec2 directory.(yourname what you put here should be same with the key pare name what you add in 11.)

Step 16: Copy private key list in your terminal (point 11) from " -----BEGIN RSA PRIVATE KEY-----" to "-----END RSA PRIVATE KEY-----" in to the "id_rsa-yourname-keypair" file.

Step 17: If you are in linux give permission to that file.

in terminal, type

   chmod 600 id_rsa-yourname-keypair

Step 18: now you finish all the configuration and you should be able to run any ami instances from command line.

Start AMI Instance

Step 19: If you want to run 32 bit ami instance,

in terminal, go to the .ec2 folder and type

   ec2-run-instance ami-ID -k yourname-keypair

Step 20: If you want to run 64 bit instance you need to type,

 ec2-run-instances ami-ID -k yourname-keypair --instance-type m1.large

Step 21: If you want to see status of the running instance you need to type this command in terminal.

"ec2-describe-instance instance-id" (instance id you can see when you are start instance using ami-id.instance id start with i-1212 etc.)

for a example if you want to run 32 bit WSAS instance you have to get AMI-ID from the wso2.com Page

WSAS ID = ami-80bd5fe9

start WSAS instance like,

 ec2-run-instance ami-80bd5fe9 -k chamara-keypair

Step 22: After few second type "ec2-describe-instance instance-id" in terminal. you will see ec2 domain name like "ec2-174-129-171-196.compute-1.amazonaws.com".this is the unique url for your running instance.

Step 23: In browser type "https://ec2-174-129-171-196.compute-1.amazonaws.com/carbon" url and you will see WSAS management console finally.

Wednesday, September 30, 2009

How to activate clustering in WSO2 WSAS

Web services application clustering is an major requirement in production environment.WSO2 carbon based products comes with the clustering functionality.To enable clustering in WSAS and other carbon based products is much easier that other  open source applications.

             To work WSAS with the clustering functionality you have to run more wsas instances in the same time.

Following are the steps to enable clustering in WSAS.(to enable clustering to all other wso2 carbon based products follow same steps.)

1. Download WSO2 WSAS.

2. Extract binary package.

3. Open axis2.xml in “WSAS_HOME/conf “ folder.

4. Change “clustering class” enable = true

Ex: 

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

5. then you have use same cluster for all the wsas instances.That cluster domain name is mention in cluster domain parameter in axis2.xml.message multicasting based on that cluster domain.

Ex:  <parameter name="domain">wso2.carbon.domain</parameter>

This is the basic of the wso2 WSAS clustering functionality. you can find more information here.

Tuesday, September 29, 2009

How to Enable Mail Notification in WSO2 Governance Registry

WSO2 Governance Registry supports a variety of notification methods.It notify most of the activities you do inside the governance registry.those are,

  • Email - Any valid email address.
  • HTML/Plain-Text - An endpoint accepting HTML or text content.
  • SOAP - An endpoint accepting notifications as a SOAP message.
  • User Profile - A valid user's profile. Notifications will be sent to the email address specified on the user's default profile.

Here is the steps you need to follow enable email notifications in WSO2 Governance Registry.

1. Download WSO2 Governance Registry.

2. Extract Binary package.

3. Open “axis2_client.xml” file inside the “WSO2Registry/conf” folder.

4. Add Following Configuration and change Mail setting what you are using.

<transportSender name="mailto"      class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
        <parameter name="mail.smtp.port">587</parameter>
        <parameter name="mail.smtp.starttls.enable">true</parameter>
        <parameter name="mail.smtp.auth">true</parameter>
        <parameter name="mail.smtp.user">chamarasilva</parameter>
        <parameter name="mail.smtp.password">mailpassword</parameter>
        <parameter name="mail.smtp.from">chamarasilva@gmail.com</parameter>
    </transportSender>

you need to change following tags in above configuration,

   1. mail.smtp.user = Username of the mail account

   2. mail.smtp.password = Password of the mail account

   3. mail.smtp.from = Email address of the mail account

5. Now start WSO2 Governance Registry server and set mail notification in each activity.

Wednesday, March 4, 2009

What would be the key factors of finding bugs....

In my knowledge there should be a specific ways to finding software bugs too easy.i think following are the key factors for make easy to finding a bugs.

1: Check for inconsistency within the product
2: Check for the Inconsistency on the purpose of the product
3: Check for inconsistency with the product versions
4: Check for inconsistency with the image a company is trying to portray
5: Check for inconsistency with a comparable product
6: Check for inconsistency with claims that are made about the product
7: Check for Inconsistency with user expectations on the product
8: Check for the Inconsistency in regards to legal requirements.
9:Talk to developers on how they have coded a piece of function(s). This may sometimes reveal scenarios
that they may have been missed out and hence chances of finding bugs becomes higher for those
scenarios.
10: Give rest to your brain and eyes. Tired eyes may miss, an easy to see bugs.

What do you think ? is this correct or not?............

Thursday, February 19, 2009

Best Automation tool to web application testing

In software quality assurance there is an many tools to automate your tests.for a example Test Complete,Selenium,mercury Win runner are most famous test automation tools in the world.
If you want to automate your test with web based application,personally i recommended to use selenium.thus it is freeware and it allows to use HTML,java and many scripting languages.my next blog will be detail explanation of using selenium for web based application testing.