JamesBranam's Blog

Monday Jun 29, 2009

AWS Experience Part 10: Configuring GlassFish in the Cloud

Hi all,

I'm still working on my cloud computing course. Now I'm more into GlassFish, and how to configure it on a virtual server. I'm not finished, but here's what I have so far:

  1. The first step in this process is to create a domain. Let's name the domain domain1. Type the following commands in the command line:
    cd /opt/gf21/glassfish
    chmod -R +x lib/ant/bin
    lib/ant/bin/ant -f setup.xml

  2. Back up the original domain1 configuration by typing
    cp /opt/gf21/glassfish/domains/domain1/config/domain.xml /opt/gf21/glassfish/domains/domain1/config/domain.xml.org.
  3. To put GlassFish tools in the path, type echo export PATH=$PATH:/opt/gf21/glassfish/bin >>~/.profile.
  4. Type exit to return to the root user.
  5. Start the server by typing /opt/gf21/glassfish/bin/asadmin start-domain domain1.
  6. Log in as the user gf21 by typing su - gf21.
  7. To tweak GlassFish configuration for use with an AWS EC2 c1.small instance, type
    asadmin create-jvm-options -- "-Xmx1024m"
    cat /opt/gf21/glassfish/domains/domain1/config/domain.xml | grep Xmx
    asadmin delete-jvm-options -- -Xmx512m
    cat /opt/gf21/glassfish/domains/domain1/config/domain.xml | grep Xmx
  8. Exit gf21 and type the following to determine if GlassFish is running:
    ps -ef |grep gf21
    svcs glassfish/domain1
    svcs -l glassfish/domain1 | grep logfile
Thanks fo Rudolf Kutina for help with this.

Cheers!

--James

Comments:

Post a Comment:
Comments are closed for this entry.

Calendar

Feeds

Search

Links

Navigation

Referrers