LBTemplating

Skip to end of metadata
Go to start of metadata

LB template for load-balancer service

Instructions to create load-balancer template to work with GlassFish and provide load-balancer service

For Native mode, user need to only create lb.zip file. Please proceed to section Installation details for Native mode.

Prerequisite for creating load-balancer template for KVM

First create a GlassFish template using provided set of instructions. If you have already created GlassFish template, then lets move on.

  • If you have a Virtual Machine(VM) for GlassFish, then just clone it. After cloning is complete, start the cloned VM.
  • Else if you have glassfish.img and glassfish.xml, then copy it to say apache.img and apache.xml respectively. You can use any other name as well. Now start virt-manager, and click on Create a new virtual machine. Select option of Import existing disk image and point to apache.img. Once VM creation is complete, then start the VM.

Creating load-balancer template

The following instructions provide details on how to install Openssl, Apache httpd and mod_jk to create a load-balancer template

Required packages

We need to compile different components for load-balancer service. Therefore we need to install make, gcc and g++ packages.

Installation details

The following directories are used as default for installation of Openssl and Apache. You can customize these directories as per your requirement.

  • APACHE HTTPD INSTALL DIR : /u01/glassfish/lb/install
  • OPENSSL INSTALL DIR : /u01/glassfish/lb/install

First create /u01/glassfish directory

Note : In case you are using other username than cloud, then please transfer ownership of directory /u01/glassfish to that user.

Installing Openssl

  • Get openssl source from Openssl site. The current latest version is openssl-1.0.0e.
  • Compile and install it using following commands

    Note : Above example uses /u01/glassfish/lb/install as openssl installation directory. You can customize it to your preferred directory. Please provide your preferred directory using --prefix option.

Installing Apache httpd

  • Get Apache httpd source from Apache site. The current latest version is httpd 2.2.21.
  • Compile and install it using following commands :

Note : Above example uses /u01/glassfish/lb/install as apache httpd installation directory. You can customize it to your preferred directory. Please provide your preferred directory using --prefix option. Also if you have installed openssl in non-default directory, please provide that directory for --with-ssl option.

Installing mod_jk module

  • Get the source for tomcat connectors from Apache site. The current latest version is jk 1.2.32.
  • Compile and install it using following commands :

Note : If you have installed apache httpd in non-default directory, please provide location of apxs under apache install directory for --with-apxs option.

Parametrize Apache httpd and configure mod_jk

  • Parametrize http port in APACHE-INSTALL-DIR/conf/httpd.conf and also add worker configuration for mod_jk module. The difference between the original and modified httpd.conf is captured below :
  • Add a placeholder worker.properties to APACHE-INSTALL-DIR/conf. This will be updated during association phase.
  • Add a placeholder glassfish-vhosts.conf and glassfish-jkmount.conf to APACHE-INSTALL-DIR/conf. This will be updated during association phase.
  • Parametrize https port in APACHE-INSTALL-DIR/conf/extra/httpd-ssl.conf and also add worker configuration for mod_jk module. The difference between the original and modified httpd-ssl.conf is captured below :

Cleanup for KVM

Once apache, openssl and mod_jk modules are installed, you can remove their source and compiled files. They are not needed any further.

Now shutdown the virtual machine, and you can use this image for adding load-balancer template in DAS.

Adding load-balancer template in DAS for KVM mode

  • Use below command to add load-balancer template in DAS if you have installed apache httpd in default directories.

    Note : Here GLASSFISH_HOME refers to your glassfish install directory, and TEMPLATE_DIR refers to directory where you have kept load-balancer image and xml file. In case you have created load-balancer image and xml files with names other name apache.img and apache.xml, then please use that.

  • Use below command to add load-balancer temmplate in DAS if you have installed apache httpd in non-default directories.

    Note : APACHE_INSTALL_DIR refers to directory where you have installed Apache httpd. GLASSFISH_HOME refers to your glassfish install directory, and TEMPLATE_DIR refers to directory where you have kept load-balancer image and xml file. In case you have created load-balancer image and xml files with names other name apache.img and apache.xml, then please use that.

Adding load-balancer template in DAS for Native mode

  • Create lb.zip file
  • Use below command to add load-balancer template in DAS if you have installed apache httpd in default directories.

    Note : Here GLASSFISH_HOME refers to your glassfish install directory

  • Use below command to add load-balancer temmplate in DAS if you have installed apache httpd in non-default directories.

    Note : APACHE_INSTALL_DIR refers to directory where you have installed Apache httpd. GLASSFISH_HOME refers to your glassfish install directory.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.