Skip to main content

elasticity in glassfish

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
piotr.tempes
Offline
Joined: 2012-02-12

Hi!

I am trying to try out elasticity feature in glassfish. I am following this tutorial:
http://glassfish.java.net/javaone2011/elasticitydemo.html
but with slight modifications. I have my own virtualization plugin. Here are commands I fired:

asadmin create-ims-config-jims --networkAddress=10.0.2.15 --networkInterface=e1000g0 --snapshotsrc=/templateZone.backup --password=futbol --zfspool=rpool
asadmin create-server-pool --subnet 10.0.2.0/24 --portname "e1000g0" --virtualization jims jimssp1
asadmin create-server-pool-user --serverpool jimssp1 --userId 0 --groupId 0 root
asadmin create-template --indexes "ServiceType=JavaEE,VirtualizationType=jims" EEjims
asadmin create-template --indexes "ServiceType=LB,VirtualizationType=jims" LBjims
asadmin create-template-user --groupid 0 --userid 0 --template LBjims --virtualization jims root
asadmin create-template-user --groupid 0 --userid 0 --template EEjims --virtualization jims root
asadmin create-machine --serverpool jimssp1 --ip 10.0.2.15 jimsm1
asadmin deploy --availabilityenabled=true --passwordfile /Desktop/glassfish3/bin/passwords.txt /Desktop/backup/SimpleSessionDemo.war
asadmin create-alert --passwordfile passwords.txt --service SimpleSessionDemo --expression "countTrue [avg(jvm_memory.heap.used)*100/jvm_memory.maxMemory > 50] /cluster_instance_size.currentSize * 100> 66" alert1

Unfortunately... I NullPointerException is thrown. I debugged code and I noticed that it is being thrown in CreateAlertCommand.java at line 144:

142. ElasticServiceContainer service = (ElasticServiceContainer) elasticServiceManager.getElasticServiceContainer(servicename);
143. AlertConfig alert  = elasticServices.getElasticService(servicename).getAlerts().getAlert(name);
144. service.addAlert(alert);

service variable is null. So my question - how can I prevent it?
How can I monitor cluster behavior? (I wish I could test my plugin)
In addition I would like to monitor it in context of load balancing. I created similar topic about loadbalancer here:
http://www.java.net/forum/topic/glassfish/glassfish/loadbalancer-glassfi...

P.S. due to secure-admin I am unable to turn on paas console

kindly thank you for any piece of advice,
Peter

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
piotr.tempes
Offline
Joined: 2012-02-12

I found CreateElasticServiceCommand class which I suppose is for creating elasticity containers, but there are some commented lines of code. Another relevant class is

ElasticEngineImpl (with startElasticService method fully commented)

Is elasticity module not ready to be used? How can I turn on auto scaling? The only way to use it is to uncomment this and make my own build or wait until it will be done?