Thursday, September 30, 2010

Build WSO2 Stratos ESB from source

Following blogpost will discuss how to build WSO2's Stratos ESB (aka Cloud ESB) from source.

1. First build carbon trunk upto features. Please follow my earlier post on building WSO2 ESB from source.

2. Checkout WSO2 Stratos source.

svn co https://svn.wso2.org/repos/wso2/trunk/stratos

Then following directories/files will be checked into your file system.

.
|-- build
|-- components
|-- features
|-- pom.xml
|-- samples
|-- services
`-- setup

3. Build Stratos components project.

heshan@heshan-laptop:~/Dev/trunk/stratos/components$ mvn clean install -Dmaven.test.skip=true

4. Build Strtos features project.

heshan@heshan-laptop:~/Dev/trunk/stratos/features$ mvn clean install -Dmaven.test.skip=true

5. Build Stratos Manager.

heshan@heshan-laptop:~/Dev/trunk/stratos/services/manager$ mvn clean install -Dmaven.test.skip=true

6. Build Stratos ESB.

heshan@heshan-laptop:~/Dev/trunk/stratos/services/esb$ mvn clean install -Dmaven.test.skip=true

7. Run the setup script.

heshan@heshan-laptop:~/Dev/trunk/stratos/setup$ ./setup.sh

8. Create the necessary databases.

mysql>CREATE DATABASE stratos_db;

mysql>CREATE DATABASE WSO2CARBON_DB;

mysql>CREATE DATABASE billing;

Create users and give necessary user-permssions.

mysql>CREATE USER 'wso2stratos'@'localhost' IDENTIFIED BY 'wso2stratos';
mysql>GRANT ALL ON *.* TO 'wso2stratos'@'localhost';

mysql>CREATE USER 'billing'@'localhost' IDENTIFIED BY 'billing';
mysql>GRANT ALL ON *.* TO 'billing'@'localhost';

Create tables.

heshan@heshan-laptop:~/Dev/trunk/stratos/services/manager/modules/distribution/target/wso2stratos-manager-1.0.0-SNAPSHOT/dbscripts$ mysql -u root -p < billing-mysql.sql billing

9. Start the Stratos Manager.
NOTE: Server should be started with -Dsetup option in the first time.

heshan@heshan-laptop:~/Dev/trunk/stratos/services/manager/modules/distribution/target/wso2stratos-manager-1.0.0-SNAPSHOT/bin$ ./wso2server.sh -Dsetup

10. Start Stratos ESB.
NOTE: Server should be started with -Dsetup option in the first time.

heshan@heshan-laptop:~/Dev/trunk/stratos/services/esb/modules/distribution/target/wso2stratos-esb-1.0.0-SNAPSHOT/bin$ ./wso2server.sh -Dsetup

11. Stop the above servers. Then startup the both the servers again without -Dsetup option.

heshan@heshan-laptop:~/Dev/trunk/stratos/services/manager/modules/distribution/target/wso2stratos-manager-1.0.0-SNAPSHOT/bin$ ./wso2server.sh
heshan@heshan-laptop:~/Dev/trunk/stratos/services/esb/modules/distribution/target/wso2stratos-esb-1.0.0-SNAPSHOT/bin$ ./wso2server.sh

12. Create a Tenent by logging into the Stratos Manager. Then using the credentials obtained, you can log into the Stratos ESB.

No comments: