Tuesday, July 19, 2011

Setting up WSO2 Stratos on a local machine.

Setting up WSO2 Stratos has become as simple as executing a few commands, this post discusses how Startos can be setup on a local machine.

You can checkout carbon from the trunk or branch and build the Stratos services and set it up locally.
Carbon trunk is found at - https://svn.wso2.org/repos/wso2/trunk/carbon/
Carbon 3.2.0 branch at - https://svn.wso2.org/repos/wso2/branches/carbon/3.2.0

Next you need to configure some variables in ~/.bashrc file as follows;
export CARBON_DIR="/home/user/trunk/carbon" => carbon checkout directory 
export STRATOS_DIR=/home/user/stratos/deploy => directory to setup stratos 
export STRATOS_VERSION=1.5.1 => Stratos version
export SSO_ENABLED=true => enable / disable single sign-on
export CREATE_DB=true
export STRATOS_MAIL_TRANSPORT='****.***.***25 false false cloud-test@gmail.com'
export NOTIFICATION_EMAIL=user@gmail.com


If you have all the Stratos services in a single directory can use use the PACKS_DIR option instead of CARBON_DIR. For Example, if all your packs are located at /home/user/services; then set the PACKS_DIR option as follows;
export PACKS_DIR=/home/user/services

In order to execute the setup script you need to install List More Utils, you can do this as follows;
$sudo apt-get install liblist-moreutils-perl
You can find the Stratos setup scripts at ${CARBON_DIR}/build directory. You can execute the setup script - stratos-setup.pl as follws;
$./stratos-setup.pl

Once you execute the script as shown above, the Stratos services will be unpacked and deployed at the directory denoted as STRATOS_DIR. Also several configuration files will be modified under the hood to ensure no port conflicts occur while starting multiple services on one machine, and also include custom URL's based on the service, in this case, esb.cloud-test.wso2.com for the ESB as a Service etc.

Once the script runs, you need to add the following host entries to the /etc/hosts file;
127.0.0.1 cloud-test.wso2.com
127.0.0.1 identity.cloud-test.wso2.com
127.0.0.1 governance.cloud-test.wso2.com
127.0.0.1 appserver.cloud-test.wso2.com
127.0.0.1 bam.cloud-test.wso2.com
127.0.0.1 dss.cloud-test.wso2.com
127.0.0.1 bps.cloud-test.wso2.com
127.0.0.1 brs.cloud-test.wso2.com
127.0.0.1 cep.cloud-test.wso2.com
127.0.0.1 esb.cloud-test.wso2.com
127.0.0.1 gadget.cloud-test.wso2.com
127.0.0.1 mb.cloud-test.wso2.com

127.0.0.1 mashup.cloud-test.wso2.com 

Now you are ready to run Straos on your machine. Simply navigate to the  $STRATOS_DIR and run the stratos.sh file as follows;
$cd $STRATOS_DIR
$sh stratos.sh start all => Starts all the Stratos services
$sh stratos.sh stop all => Stop all the running Stratos services

Alternately you can change to specific service directory and start the respective server. To starts Stratos ESB you can simply do;
$cd $STRATOS_DIR/wso2stratos-esb-1.5.1
$sh bin/wso2server.sh

The option Single Sign-On means that once a user logs in to a single service, eg: Stratos Manager using their credentials they will automatically be signed in to any other service eg: ESB or Governance.

Hope you enjoy using WSO2 Stratos !!!

3 comments:

  1. Hi:

    I get this when I launch: stratos.pl start all

    root@cloud:~/stratos/deploy# ./stratos.sh start all
    STRATOS_DIR environment variable is set to /root/stratos/deploy
    STARTUP DELAY environment variable is not set, using the default value of 50 seconds
    Starting WSO2 Stratos Application Server v1.5.1...
    eval: 1: /root/stratos/deploy/wso2stratos-as-1.5.1/./bin/native/wrapper-linux-x86-32: not found
    sleep: missing operand
    Try `sleep --help' for more information.

    Any ideas?

    Cheers,
    Dave

    ReplyDelete
  2. I figured it out. I use Ubuntu Server 10.04 64 bit so I changed the line in all the daemon.sh scripts to: WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64"
    Also set a STARTUP_DELAY env variable. All is good.
    Cheers,
    Dave

    ReplyDelete
  3. Hello there Shariq,

    You might not actively post on your blog anymore, but I was wondering whethr you could give us (informatics university from the Netherlands) some hands-on pointers as how to implement WSO2's Stratos PaaS?

    We are having quite some issues getting it to run. The VMWARE Image that is provided by WSO2 works, but only the Indentity Server and the manager are working.

    We want to implement the Stratos PaaS in an EU-subsidized project that's about to launch (we are the first iteration, researching WSO2, and its usage).

    Please get back to me if possible at e.j.hoeksma@st.hanze.nl

    ReplyDelete