Cloud Computing Made Easy®
3-Tier Jboss
From Cloud Computing Wiki - Kaavo
Contents |
Overview
This is a Sample System Definitions for demonstrating the deployment of a Enterprise Java application in a 3 tier setup. System has 3-tiers:
- DB_tier: MySQL Cluster (starting with 2 identical nodes)
- App_tier: JBoss Application Server Cluster (starting with 2 identical nodes)
- Web_tier: Apache HTTP Service (1 node)
Scaling up, scaling down, and recovery actions/workflows are defined for Jboss and MySQL clusters, so users can easily scale the JBoss Cluster, or MySQL cluster or configure triggers to run the system on autopilot during runtime. Like other Sample System Definitions provided with IMOD, the Apache-JBoss-MySQL-EC2 is provided as an example. Users are expected to develop their own system definitions or customize the provided solutions for their own needs. The System Definition can be modified to deploy J2EE applications on any Kaavo supported platform. The information assumes that the user has basic understanding of deploying and starting systems in IMOD.
In this example after bring up the 3 tier Enterprise Java platform we automatically deploy one sample application (as sampleapp.war). Users can easily change the input parameters for the actions to deploy their own custom Java application on the instantiated platform.
Note : We have tested this template with Fedora 8, 32 Bit for all servers in web_tier, app_tier and db_tier.
HTTP session replication is not enabled across JBoss nodes. Load balancer has sticky session configuration.
Inputs
For testing we need following inputs in the actions a) Location of the ear/war file b) Database schema name, username and password c) Location of database restore and backup process
In case there are any issues or questions please post them on http://forums.kaavo.com
After the application is up and running you can go to the http://ip-address-of-loadbalancer/sampleapp to start using the application.
Note: The provided sample application will first check whether there is any valid database connection or not, then check for whether there are any table/s or not. If no table/s found it will create tables ('sampleuser', 'samplerecords') and insert some records into 'sampleuser' for successfully login into the sample application. After the table has been created, one login screen will appear and user needs to provide username as 'sagar' and password as 'sagar' to login.
What deployment time Actions are included in the System Definition?
This system is divided into three parts.
*DB_tier: MySQL server and data node are running here
*App_tier: JBoss Application Server and MySQL manager are running here
*Web_tier: Apache HTTP Service is running here
In these system, we start different tier in a specific order. First DB_tier, then App_tier and at last Web_tier gets started.
*Action for installing and starting DB_tier:
- install-mysql-ndbd
- create-ndbd-config
- ndb-api-start
- grant-mysql
*Action for installing and starting App_tier:
- install-mysql-manager
- create-manager-config
- manager-kick-start
- install-java
- download-ear-or-war-file
- configure-jboss
- create-application-ds
- start-jboss
*Action for installing and starting Web_tier:
- create-workers-properties
- start-apache
What run-time Events are defined in the System Definition?
a) After the system has been successfully deployed and running, we need to restore the schema/data from user defined location.
Event : restore-database-from-s3files
Action : restore-database-from-s3files
It will take three inputs
DB_BACKUP_FILE: Database backup file name
BUCKET: Location of the database backup file
DBNAME: Name of the database
b) For scaling up the JBoss into the system trigger the event "ScaleUpApp_tier"
c) For scaling down the JBoss from the system trigger the event "ScaleDownApp_tier"
d) For recovering dead JBoss in the system trigger the event "RecoverApp_tier"
e) For scaling up the MySQL Data node into the system trigger the event "ScaleUpDB_Tier"
f) For scaling down the MySQL Data node from the system trigger the event "ScaleDownDB_tier"
g) For recovering dead MySQL Data node in the system trigger the event "RecoverDB_tier"
h) For recovering dead Apache server in the system trigger the event "RecoverWeb_tier"
How to deploy your own application?
It is very easy to deploy your J2EE application in the system. You need to go the action tab for the system and edit the appropriate inputs for the relevant actions, e.g. location of ear/war file, file name. Following are screen shots of some relevant actions and the inputs you may want to replace with your own inputs.
Step 1: For downloading ear or war file for your application in action 'download-ear-or-war-file'.
Find below the screen shot
Step 2: Modify JNDI name, database name, username, password for your application in the action 'create-application-ds'
Step 3: Modify database name, username, password for your application in the action 'create-jboss-jmsds'
Step 4: For database grant permission it needs database schema name, usename, passowrd as parameter in the action 'grant-mysql'.
Find below the screen shot
Step 5: Configure your access_key and secret_key in action 'SetupS3cfg'
Step 6: For restoring the data into the MySQL server, it needs the file name, location and database schema name as parameter in the action 'restore-database-from-s3files'.
Find below the screen shot
Step 7: For backup of valuable data, it needs the location, database schema name in the action 'backup-database'.
Find below the screen shot
Step 8: Modify the name of the ear or war file in action 'start-jboss'
Step 9: Specify the 'contextPath' for your application in action 'create-mod-jk-conf'
![[Wiki Home]](/skins/common/images/wiki.png)