Saturday, October 20, 2012

How to Deploy WSO2 Stratos Locally

WSO2 Stratos is a complete open source PaaS where you can use any of the WSO2 products as a service. This article describes how to set up WSO2 stratos locally by following few simple steps.


Prerequisites

mysql
following perl modules

  • File::Copy ( sudo apt-get install libfile-copy-recursive-perl )
  • File::Path (sudo apt-get install libfile-path-perl )
  • File::Basename (sudo apt-get install libfile-basedir-perl )
  • XML::LibXML (sudo apt-get install libxml-libxml-perl
    • You many need to install libxml2-dev first- sudo apt-get install libxml2-dev)
  • Archive::Zip ( sudo apt-get install libarchive-zip-perl )
  • Getopt::Std (sudo apt-get install libgetopt-declare-perl )
  • List::MoreUtils ( sudo apt-get install liblist-moreutils-perl )


Introduction


WSO2 Stratos is a complete open source Platform as a service (PaaS). You can use any WSO2 product through WSO2 Stratos Live which is the public online platform. And now you have the capability of deploying WSO2 Stratos in your personal computer by executing just a few simple steps. You can deploy WSO2 Stratos as a private cloud in your local machine with any of the WSO2 services required. Following are those service names with the terms that you can use to indicate them at the deployment time.


Service Name
term
WSO2 Stratos (Manager)
manager
WSO2 Business Process Server
bps
WSO2 Business Activity Monitor
bam
WSO2 Application Server
as
WSO2 Identity Server
is
WSO2 Enterprise Service Bus
esb
WSO2 Governance Registry
greg
WSO2 Data Service Server
dss
WSO2 Gadget Server
gs
WSO2 Mashup Server
ms
WSO2 Business Rules Server
brs
WSO2 Complex Event Processing Server
cep
WSO2 Message Broker
mb



Applies To

Service packs of version 1.5.2


Downloading Binaries

  • First you have to download the binaries of the services that is required to deploy as services. The binary files of WSO2 Stratos services can be found in WSO2 Stratos release page.
  • Download the required binary files listed under ‘Stratos Packs’.
  • By running the WSO2 Stratos setup script which can be downloaded from here

you can simply setup WSO2 Stratos in your machine in few minutes.


 Preparing to Setup WSO2 Stratos


  • Now you are ready to deploy WSO2 Stratos in your machine with the binary files that you have already downloaded. First copy all the binary files of the required services to one directory, e.g home/usr/stratos/packs.


Run the Script


  • Now by simply executing the setup script and following the instruction given you can deploy stratos. For that use terminal and navigate to the build directory that you have checked out now.
  • Give execute permission to the setup script by running chmod 755 ./stratos-setup.pl
  • Run the following command with the required fields filled.

./stratos-setup.pl -p -t -v "" -s -d -l "" -c -u -w

-p : path to stratos packs directory (here /home/usr/stratos/packs)

-t : path that you want to deploy stratos ( Note that you should give the location of an   empty directory. If not the script will delete all the files/directories inside that given directory )

-v : version of the packs. ( All the packs should have the same version)

-s : whether you want to enable single sign on
If you put '-s true' you must deploy IS pack and to start any other service, you need to start IS. The advantage is that you would be able to to access any other server that you have started, without entering user credentials.
-d : whether to create the database. (At the first time you deploy stratos you should set this to true to create the relevant database and the tables)

-l : names of services that you need to deploy. These names should be separated by a space. If you want to deploy IS,manager and greg put ‘-l is manager greg’

-c : path to stratos_config_min.xml ( It is in the checked out 'build' directory )

-u : database username

-w : database password

(ex : ./stratos-setup.pl -p /home/usr/stratos/packs -t /home/usr/stratos/deploy -v "1.5.2" -s false -d true -l "is manager greg" -c ./stratos_config_min.xml -u myusername -w mypassword )
This script will setup the services locally.


Adding Entries to /etc/hosts


You will be informed to add the following lines to /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 monitor.cloud-test.wso2.com
127.0.0.1 data.cloud-test.wso2.com
127.0.0.1 process.cloud-test.wso2.com
127.0.0.1 rule.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  messaging.cloud-test.wso2.com
127.0.0.1 mashup.cloud-test.wso2.com

By adding the entries to /etc/hosts file you can complete the stratos local deployment process. The deployed services will be in the deployment directory. ( here in /home/usr/stratos/deploy )


Starting Services

  • You can start any service by navigating to the bin folder of that service ( /home/usr/stratos/deploy//bin ) and running the command ./wso2server.sh
  • To start all WSO2 Stratos services in one command, navigate to the deploy folder ( /home/usr/stratos/deploy/ ) and run ./stratos.sh start all and to stop ./stratos.sh stop all

No comments:

Post a Comment