Quick Start with Sailfin Clustering
By 143562 on Feb 17, 2009
You are at the right place if you are looking to quickly create a sailfin cluster and test it. This blog also has links to some helpful documentation and useful blogs around sailfin and glassfish.
Lets get started then...
Get Sailfin Installed and get it ready for Clustering (taken from sailfin instructions):
Download the Build from here
Set JAVA_HOME environment variable
java -Xmx256m -jar <sailfin-installer-file>.jar
chmod -R +x lib/ant/bin
lib/ant/bin/ant -f setup-cluster.xml
Creating a SailFin Cluster
1. How many machines will be involved in the setup ?
2. Which machine will host the domain and which machines will host instances ?
What do the below steps create: 2 machine setup (cluster with 2 instances, one on each machine)
Machine 1: Domain, 1 Node-Agent, 1 instance
Machine 2: 1 Node-Agent, 1 instance
a. Names for the domain, node-agents, cluster and instances can of-course be changed to your liking
b. Unless specified all the below commands are to be executed on Machine 1.
c. Each machine that hosts an instance must have a node-agent created on it.
asadmin create-domain --user admin --adminport 4848 my-domain [enter a adminpassword, accept defaults for the master password]
asadmin start-domain my-domain
asadmin create-node-agent --host <hostname-domain-machine> agent1
asadmin create-node-agent --host <hostname-domain-machine> agent2 (to be executed on Machine 2)
asadmin start-node-agent agent1
asadmin start-node-agent agent2 (to be executed on Machine 2)
asadmin create-cluster my-cluster
asadmin create-instance --node-agent agent1 --cluster my-cluster instance1
asadmin create-instance --node-agent agent2 --cluster my-cluster instance2
asadmin create-converged-lb --autocommit=true --configfile my-lb.xml --target my-cluster my-lb
asadmin start-cluster my-cluster
asadmin deploy --target st-cluster <path-to-your-app>
If you intend to use a single machine for the setup, you only need to create one node-agent and all instances created on that machine need to be associated with that node-agent.
The above steps create a ready-to-use Sailfin Cluster with 2 instances that also sports the Converged Load Balancer functionality. Go ahead, deploy your apps on Sailfin or write your own simple sip app or start with our samples, try SIP (default instance-sip-service port is 35060) and HTTP (default instance-http-service port is 38080) traffic and let us know how it goes....