The tasks you must perform to install and configure Apache Tomcat in the global zone are as follows:
Example: Installing the Apache Tomcat Software on Shared Storage
Example: Enabling the Apache Tomcat Software to Run in the Cluster
Install and configure the cluster as instructed in Sun Cluster Software Installation Guide for Solaris OS.
Install the following cluster software components on both nodes.
Sun Cluster core software
Sun Cluster data service for Apache Tomcat
Beginning on the node that owns the file system, add the tomcat user.
phys-schost-1# groupadd -g 1000 tomcat phys-schost-2# groupadd -g 1000 tomcat phys-schost-1# useradd -g 1000 -d /global/mnt3/tomcat -m -s /bin/ksh tomcat phys-schost-2# useradd -g 1000 -d /global/mnt3/tomcat -m -s /bin/ksh tomcat |
Register the necessary data types on both nodes.
phys-schost-1# clresourcetype register SUNW.gds SUNW.HAStoragePlus |
Create the Apache Tomcat resource group.
phys-schost-1# clresourcegroup create RG-TOM |
Create the logical host.
phys-schost-1# clreslogicalhostname create -g RG-TOM ha-host-1 |
Create the HAStoragePlus resource in the RG-TOM resource group.
phys-schost-1# clresource create -g RG-TOM -t SUNW.HAStoragePlus -p AffinityOn=TRUE \ -p FilesystemMountPoints=/global/mnt3,/global/mnt4 RS-TOM-HAS |
Enable the resource group.
phys-schost-1# clresourcegroup online -M RG-TOM |
These steps illustrate how to install the Apache Tomcat software in the directory /global/mnt3/tomcat. As long as only one node is mentioned it needs to be the node where your resource group is online.
Install the Apache Tomcat binaries on.
phys-schost-1# su - tomcat phys-schost-1# gzcat apache-tomcat-5.5.17.tar.gz|tar xvf - phys-schost-1# gzcat apache-tomcat-5.5.17-compat.tar.gz|tar xvf - |
Create your environment script /global/mnt3/tomcat/env.kshwith the following contents.
cat env.ksh #!/usr/bin/ksh JAVA_HOMME=/usr/j2se CATALINA_HOME=/global/mnt3/tomcat/apache-tomcat-5.5.17 export JAVA_HOME CATALINA_HOME |
Copy the Apache Tomcat configuration file from the agent directory to its deployment location.
phys-schost-1# cp /opt/SUNWsctomcat/util/sctomcat_config /global/mnt3 phys-schost-1# cp /opt/SUNWsctomcat/bin/pfile /global/mnt3 phys-schost-1# chown tomcat:tomcat /global/mnt3/pfile |
Add this cluster's information to the sctomcat_config configuration file.
The following listing shows the relevant file entries and the values to assign to each entry.
. . . RS=RS-TOM RG=RG-TOM PORT=8080 LH=ha-host-1 NETWORK=true SCALABLE=false PFILE=/global/mnt3/pfile HAS_RS=RS-TOM-HAS |
Save and close the file.
Add this cluster's information to the parameter file /global/mnt3/pfile.
The following listing shows the relevant file entries and the values to assign to each entry.
. . . EnvScript=/global/mnt3/tomcat/env.ksh User=tomcat Basepath=/global/mnt3/tomcat/apache-tomcat-5.5.17 Host=ha-host-1 Port=8080 TestCmd="get /index.jsp" ReturnString="CATALINA" Startwait=20 |
Save and close the file.