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!

This entry was posted in cloud computing, wso2 stratos. Bookmark the permalink.

Comments are closed.