WebSphere CE has the ability to share session state, but not in an efficient, scalable manner. WebSphere eXtreme Scale provides a high performance, distributed persistence layer which can be used to replicate state, but does not readily integrate with any application server outside of WebSphere. This topic will focus on explaining how to integrate these two products to provide a scalable session-management solution. We will be using CE's own modular infrastructure, GBeans, to embed eXtreme Scale as the session-state persistence mechanism.
The backbone of CE, the kernel, relies on outward modules, referred to as GBeans, to provide function and capabilities.
The following section(s) will take you through integrating WebSphere CE or Geronimo with ObjectGrid via the provided GBean implementation. While the initial section is intended to be a concise tutorial, the various components of the process will be explained in more detail as they are introduced. It is assumed that you have already unzipped or installed Geronimo/CE and ObjectGrid on your system.
Distributing the GBean
Prior to eXtreme Scale 6.1.0.5, it was only possible to integrate with Websphere CE via the sample files provided on this Wiki. Version 6.1.0.5 added the samples to be built and distributed with the install image. The integration process is now automated, assuming the end-user has properly installed both ObjectGrid and Websphere CE on their system. The integration steps are listed below. (Note that ceRoot specifies the directory where WebSphere Application Server Community Edition is installed.)
- Navigate to the objectgridRoot/bin directory
- Execute the addToCeRepository script for the system that you are running on using the following syntax
addToRepository.sh ceRoot
addToRepository.bat ceRoot
- You should now receive feedback letting you know that the JARs were distributed properly
Editing the configuration file
Now that the GBean is distributed, we will need to let CE know that it should be launched at server startup. The config.xml file will allow us to both register the GBean, and supply it with configurable arguments which can then be utilized at runtime.
- Navigate to the ceRoot/var/config directory
- Open the config.xml in a plain text editor
- Scroll down within the file until you see the following line:
<module name="org.apache.geronimo.plugins/mconsole-ds/2.1.1/car"/>
</attributes>
- Append the following excerpt before the </attributes> tag.
<module name="com.ibm.websphere.objectgrid/gbean/1.0/car">
<gbean name="objectgrid/BringupPlugin">
<attribute name="objectgridHome">c:\objectgrid</attribute>
<attribute name="geronimoHome">C:\websphereCE</attribute>
<attribute name="serverName">server1</attribute>
<attribute name="catalogServiceEndPoints">host:port</attribute>
<attribute name="replicationDisabled">false</attribute>
<attribute name="traceSpecification">*=all=disabled</attribute>
</gbean>
</module>
- The values for the GBean parameters above are only examples. They will need to be configured later and are used in the following manner:
- objectgridHome - installation directory of eXtreme Scale - objectgridRoot
- geronimoHome - installation directory of WebSphere CE/Apache Geronimo - ceRoot
- serverName - must be unique for every CE/eXtreme Scale server instance
- catalogServiceEndPoints - host and port of the eventual catalog server
- replicationDisabled - toggles replication of session state
- traceSpecification - trace specification for the ObjectGrid container within the JVM
Starting a catalog server
At this point in the tutorial, your CE image will successfully be able to launch an ObjectGrid server within its JVM at server startup. In order for an eXtreme Scale server to bootstrap, however, you will need to start a catalog server first. The catalog server is analogous to a dmgr within a WebSphere topology and must be started prior to CE launching in this case. Once the catalog server is started, you will need to enter its hostname and port into the config.xml within the GBean entry you added above. See starting a catalog service for more information.
Be sure to read the section on binding the ORB port to a particular hostname and port. You will need to specify those endpoints within the GBean configuration above. If you have a port conflict on server startup, you must open the ceRoot/var/config/config-substitutions.properties file and change the "NamingPort" key to a value other than 1099.
Starting WebSphere CE to test the bootstrap
- Navigate to the ceRoot/bin directory
- Set the JAVA_HOME environment variable:
- Run the following command:
geronimo.sh run
geronimo.bat run
The server should now start up and begin to initialize its components or GBeans. The ObjectGrid plugin will be the last plugin to load and will output the necessary startup trace and information statements.
Additional Information