Category → cloud computing

Howto install WSO2 Stratos?

If you tried the hosted version of WSO2 Stratos at cloud.wso2.com and wants to get down to install it in your virtualized environment, this will help you to build it from the source code. Before you build WSO2 Stratos you have to build WSO2 Carbon. This guide only assumes that you’ve installed Sun JDK and Apache Maven which is in your PATH.

Building WSO2 Stratos

  1. Checkout WSO2 Carbon and WSO2 Stratos

    $ svn checkout http://svn.wso2.org/repos/wso2/trunk/carbon
    $ svn checkout http://svn.wso2.org/repos/wso2/trunk/stratos
    

  2. In order to build WSO2 Carbon, first need to build two Axis2 plugins. As the Axis2 README points out, this is due to some dependency resolution issues in Maven
    • Build Axis2 AAR Maven plugin

      $ cd carbon/dependencies/axis2/modules/tool/axis2-aar-maven-plugin/
      $ mvn clean install
      

    • Bulid Axis2 MAR Maven plugin

      $ cd carbon/dependencies/axis2/modules/tool/axis2-mar-maven-plugin/
      $ mvn clean install
      

  3. Build Carbon dependencies

    $ cd carbon/dependencies
    $ mvn clean install
    

  4. Build Carbon Orbit

    $ cd carbon/orbit
    $ mvn clean install
    

  5. Bulid Carbon core

    $ cd carbon/core
    $ mvn clean install
    

  6. Bulid Carbon components

    $ cd carbon/components
    $ mvn clean install
    

  7. Build Carbon features

    $ cd carbon/features
    $ mvn clean install
    

  8. Build WSO2 Stratos
    • Bulid WSO2 Stratos components

      $ cd stratos/components
      $ mvn clean install
      

    • Build WSO2 Stratos features

      $ cd stratos/components
      $ mvn clean install
      

    • Build WSO2 Stratos services

      $ cd stratos/services
      $ mvn clean install
      

      This will create binary distributions for each service in, stratos/services//modules/distribution/target

Configuring WSO2 Stratos

Cloud manager is a special program designed to manage all other services. Therefore some configuration parameters differ from other services. There are some configuration parameters which are common across all the services.

Once you build WSO2 Stratos, unzip binary packages to a folder. <statos dir> in the following configurations refer to the folder you get when you unzip a binary distribution.

Common configurations

These are common to cloud manager as well as other services. Configuration files are located at <stratos dir>/repository/conf

  1. carbon.xml

    You should change ServerURL, HostName, and Name parameter. E.g.,

    <ServerURL>https://example.com${carbon.context}/services/</ServerURL>
    <HostName>example.com</HostName>
    <Name>WSO2 Stratos Cloud Application Server</Name> (this name should
    be same as the name given in cloud-services-desc.xml cloud manager)
    

  2. axis2.xml

    Configure mail transport. E.g.,

    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
            <parameter name="mail.smtp.host">smtp.example.org</parameter>
            <parameter name="mail.smtp.port">25</parameter>
            <parameter name="mail.smtp.starttls.enable">false</parameter>
            <parameter name="mail.smtp.auth">true</parameter>
            <parameter name="mail.smtp.user">user</parameter>
            <parameter name="mail.smtp.password">password</parameter>
            <parameter name="mail.smtp.from">noreply@example.com</parameter>
    </transportSender>
    

  3. mgt-transport.xml

    Configure proxy ports. E.g.,

    <transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
            <parameter name="port">9763</parameter>1
            <parameter name="proxyPort">80</parameter>
            ...
    
    <transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
            <parameter name="port">9443</parameter>
            <parameter name="proxyPort">443</parameter>
    

  4. registry.xml

    Database configuration. E.g.,

    </dbConfig>
            <dbConfig name="WSO2Registry">
            <url>jdbc:mysql://db.example.com:3306/registry_db?autoReconnect=true</url>
            <userName>user</userName>
            <password>password</password>
            <driverName>com.mysql.jdbc.Driver</driverName>
            <maxActive>50</maxActive>
            <maxWait>60000</maxWait>
            <minIdle>5</minIdle>
            <validationQuery>SELECT 1</validationQuery>
    </dbConfig>
    

  5. user-mgt.xml

    Configure user store. E.g.,

    <Property name="url">jdbc:mysql://db.example.com:3306/userstore_db?autoReconnect=true</Property>
    <Property name="userName">user</Property>
    <Property name="password">password</Property>
    <Property name="driverName">com.mysql.jdbc.Driver</Property>
    <Property name="maxActive">50</Property>
    <Property name="maxWait">60000</Property>
    <Property name="minIdle">5</Property>
    <Property name="MultiTenantRealmConfigBuilder">org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder</Property>
    <Property name="validationQuery">SELECT 1</Property>
    

  6. Copy MySQL JDBC driver to <stratos dir>/repository/components/lib. MySQL JDBC driver can be downloaded from http://dev.mysql.com/downloads/connector/j/
  7. wrapper.conf

    wrapper.java.additional.11=-Dcarbon.https.port=443
    wrapper.java.additional.12=-Dcarbon.http.port=80
    

  8. axis2_client.xml

    Increase SO_TIMEOUT of http and https about 60 seconds <parameter name="SO_TIMEOUT">60000</parameter>

Cloud Manager Configuration

  1. billing-config.xml

    Database configuration. E.g.,

    <dbConfig>
            <url>jdbc:mysql://db.example.com:3306/billing_db?autoReconnect=true</url>
            <userName>user</userName>
            <password>password</password>
            <driverName>com.mysql.jdbc.Driver</driverName>
            <maxActive>80</maxActive>
            <maxWait>60000</maxWait>
            <minIdle>5</minIdle>
            <validationQuery>SELECT 1</validationQuery>
    </dbConfig>
    

  2. tenant-reg-agent.xml

    <tenantRegListenerServers>
            <server>
                <!-- governance -->
                <serverUrl>https://governance.example.com/services/</serverUrl>
                <userName>admin</userName>
                <password>password</password>
            </server>
            <server>
                <!-- identity -->
                <serverUrl>https://identity.example.com/services/</serverUrl>
                <userName>admin</userName>
                <password>password</password>
            </server>
            <server>
                <!-- gadget -->
                <serverUrl>https://gadget.example.com/services/</serverUrl>
                <userName>admin</userName>
                <password>password</password>
            </server>
            ...
    </tenantRegListenerServers>
    

  3. cloud-services-desc.xml

    <cloudService name="WSO2 Stratos Cloud Governance">
            <label>Cloud Governance</label>
            <link>https://governance.example.com</link>
            <description>Governance in the cloud.</description>
            <icon>
    
    https://example.com/cloud-services-icons/governance.gif
    
            </icon>
    </cloudService>
    

  4. All the configurations starting with email_ should be modified with correct
    cloud manager URL

Other services

Other services means all the services except could manager.

  1. metering-config.xml

    Metering configuration have to be changed to include cloud admin username, password (in post handler and pre handler)

    <handler service="org.wso2.stratos.metering.agent.handlers.RemoteTaskInvoker" async="true" frequency="1">
            <parameter name="taskServiceUrl">https://cloud.wso2.com/services/</parameter>
            <parameter name="userName">user</parameter>
            <parameter name="password">password</parameter>
            <parameter name="taskName">org.wso2.stratos.metering.manager.task.PerRegistryRequestRemoteTask</parameter>
    </handler>
    

  2. In Appserver carbon.xml, you can specify the URL for BAM so that you can monitor appserver.

    <BamServerURL>https://bam.example.com/services/BAMServiceStatisticsSubscriberService</BamServerURL>
    

That’s it!

Private cloud endeth?!

I agree with what Werner said about the private cloud. From Amazon’s point of view, it make sense to “kill it” since they’re not going to make money when someone is having a private cloud. So it’s logical to sell their VPC offering as a replacement to a private cloud.

If you take a step back and look at the big picture, I think the audience for a private cloud is vastly different from the audience for a public cloud.

Public cloud is the ideal solution if you’re just a startup trying to setup infrastructure such as source code repositories, bug trackers, wikis, CRMs and so on. Utilizing features of a public cloud like Amazon EC2, you can increase the computing resource when you need it. No need to pay big sums upfront for high end hardware. You can expand or shrink your computing resources as you go along.

Private cloud, on the other hand, is useful if you already have the hardware. You have purchased high end hardware anticipating your resource needs in the future and now they’re under utilized. In this case, having a private cloud infrastructure will help you to make use of your otherwise idle computing resources. Pay as you go feature of public clouds doesn’t apply in this case. Elasticity, yes, if your applications are written using the same APIs.

For example, WSO2 Stratos, can scale in Amazon EC2 as well as in a private cloud such as UEC (Ubuntu Enterprise Cloud). UEC runs Eucalyptus for providing a private cloud infrastructure which is API compatible with Amazon EC2/S3/EBS.

So, IMHO, public cloud and private cloud has their own places in this world.

Cloud native middleware

Also known as WSO2 Stratos and it’s all open source. It comes in two forms. You can either set it up on top of a private cloud used in an enterprise or you could try out the hosted service at cloud.wso2.com.

Samisa has written a post giving some background about how Stratos came to life. Infoworld has some more info.

Usually people don’t open up all their source code that goes into a hosted version. But the source code for WSO2 Stratos is open source and available with an Apache license. You can grab a source tarball here or checkout the source code using subversion.