It's working now. I copied and pasted the jvmRoute parameter in from
another config.xml and it worked. Although it was exactly the same there
were some carriage returns in the one I pasted. Seems like the config.xml
is pretty touchy.
Ryan Shows
Configuration Manager
Electronic Payment Services
Symcor Inc.
416-673-3824
[EMAIL PROTECTED]
Hernan Cunico
<[EMAIL PROTECTED]
m> To
[email protected]
27/10/2006 02:12 cc
PM
Subject
Re: Apache load balancing w/
Please respond to Geronimo
[EMAIL PROTECTED]
che.org
Hi Ryan,
It looks like you followed this sample
http://cwiki.apache.org/GMOxDOC11/clustering-sample-application.html
The conf looks good to me however I would like to check the web.xml, more
specifically to see whether you are defined the distributable attribute or
not.
Cheers!
Hernan
[EMAIL PROTECTED] wrote:
I have setup Apache using mod_jk to load balance across two Geronimo 1.1
.
It seems to work except for sticky sessions. I kept getting switched
back
and forth between the two geronimo servers.
Here is my Apache config:
# Location of the worker file
JkWorkersFile "conf/workers.properties"
# Location of the log file
JkLogFile "logs/mod_jk.log"
# Log level : debug, info, error or emerg
JkLogLevel debug
# Assign specific URL to Tomcat workers
JkMount /* loadbalancer
Here is my worker.properties:
# List the workers name
worker.list=loadbalancer,status
# ----------------
# First worker
# ----------------
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
# Load balance factor
worker.worker1.lbfactor=1
# ----------------
# Second worker
# ----------------
worker.worker2.port=8019
worker.worker2.host=localhost
worker.worker2.type=ajp13
worker.worker2.lbfactor=1
# ----------------------
# Load Balancer worker
# ----------------------
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
worker.loadbalancer.sticky_session=1
worker.status.type=status
config.xml server 1:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================== -->
<!-- Warning - This XML file is re-generated by Geronimo when -->
<!-- changes are made to Geronimo's configuration, therefore -->
<!-- any comments added to this file will be lost. -->
<!-- Do not edit this file while Geronimo is running. -->
<!-- ======================================================== -->
<attributes xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1">
<module name="geronimo/rmi-naming/1.1/car">
<gbean name="RMIRegistry">
<attribute name="port">1099</attribute>
</gbean>
<gbean name="NamingProperties">
<attribute name="namingProviderUrl">rmi://0.0.0.0:1099</attribute>
</gbean>
<gbean name="DownloadedPluginRepos">
<attribute
name="repositoryList">http://people.apache.org/~ammulder/plugin-repository-list-1.1.txt</attribute>
<attribute name="userRepositories">[]</attribute>
</gbean>
</module>
<module name="geronimo/j2ee-server/1.1/car"/>
<module name="geronimo/j2ee-security/1.1/car">
<gbean name="JaasLoginServiceRemotingServer">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">4242</attribute>
</gbean>
<gbean name="JMXService">
<attribute name="protocol">rmi</attribute>
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">9998</attribute>
<attribute
name="urlPath">/jndi/rmi://0.0.0.0:1099/JMXConnector</attribute>
</gbean>
</module>
<module name="geronimo/axis/1.1/car"/>
<module name="geronimo/openejb/1.1/car">
<gbean name="EJBNetworkService">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">4201</attribute>
</gbean>
</module>
<module load="false" name="geronimo/j2ee-corba/1.1/car">
<gbean name="NameServer">
<attribute name="dbDir">var/cosnaming.db</attribute>
<attribute name="port">1050</attribute>
</gbean>
<gbean name="Server">
<attribute name="args">-ORBInitRef,
NameService=corbaloc::localhost:1050/NameService</attribute>
</gbean>
<gbean name="UnprotectedServer">
<attribute name="args">-ORBInitRef,
NameService=corbaloc::localhost:1050/NameService</attribute>
</gbean>
</module>
<module name="geronimo/system-database/1.1/car">
<gbean name="DerbyNetwork">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">1527</attribute>
</gbean>
</module>
<module name="geronimo/activemq-broker/1.1/car">
<gbean name="ActiveMQ.tcp.default">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">61616</attribute>
</gbean>
</module>
<module name="geronimo/activemq/1.1/car"/>
<module name="geronimo/tomcat/1.1/car">
<gbean name="TomcatResources"/>
<gbean name="TomcatEngine">
<attribute name="initParams">name=Geronimo
jvmRoute=worker1</attribute>
</gbean>
<gbean name="TomcatWebConnector">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">8080</attribute>
<attribute name="redirectPort">8443</attribute>
<attribute name="maxThreads">1000</attribute>
<attribute name="minSpareThreads">50</attribute>
<attribute name="maxSpareThreads">1000</attribute>
</gbean>
<gbean name="TomcatAJPConnector">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">8009</attribute>
<attribute name="redirectPort">8443</attribute>
</gbean>
<gbean name="TomcatWebSSLConnector">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">8443</attribute>
</gbean>
<gbean
name="geronimo/tomcat/1.1/car?ServiceModule=geronimo/tomcat/1.1/car,j2eeType=GBean,name=TomcatWebContainer">
<attribute name="catalinaHome">var/catalina</attribute>
</gbean>
</module>
<module name="geronimo/geronimo-gbean-deployer/1.1/car"/>
<module name="geronimo/j2ee-deployer/1.1/car">
<gbean name="WebBuilder">
<attribute
name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1
</attribute>
</gbean>
</module>
<module name="geronimo/openejb-deployer/1.1/car">
<gbean name="EJBBuilder">
<attribute name="listener">?name=TomcatWebContainer</attribute>
</gbean>
</module>
<module name="geronimo/client-deployer/1.1/car"/>
<module name="geronimo/axis-deployer/1.1/car"/>
<module load="false" name="geronimo/javamail/1.1/car">
<gbean name="SMTPTransport">
<attribute name="host">localhost</attribute>
<attribute name="port">25</attribute>
</gbean>
</module>
<module name="geronimo/sharedlib/1.1/car">
<gbean name="SharedLib">
<attribute name="classesDirs">var/shared/classes</attribute>
<attribute name="libDirs">var/shared/lib</attribute>
</gbean>
</module>
<module name="geronimo/tomcat-deployer/1.1/car"/>
<module name="geronimo/welcome-tomcat/1.1/car"/>
<module name="geronimo/webconsole-tomcat/1.1/car"/>
<module load="false" name="geronimo/uddi-tomcat/1.1/car"/>
<module name="geronimo/remote-deploy-tomcat/1.1/car"/>
<module name="geronimo/hot-deployer/1.1/car"/>
<module load="false" name="geronimo/SampleBankCSP/1.1/war"/>
<module load="false" name="default/SamplePostOfficeCSP/1-default/car"/>
<module load="false" name="geronimo/SamplePostOfficeCSP/1.1/war"/>
<module name="console/realm-persistLogin/1.0/car"/>
<module name="geronimo/iCareConsole/1.1/war"/>
<module name="geronimo/MetroBank/1.1/war"/>
<module name="geronimo/Symcorgui/1.1/war"/>
<module name="geronimo/MetroPhonePortal/1.1/war"/>
<module name="geronimo/SymcorMD/1.1/war"/>
<module load="false" name="default/whoami/1159900133326/war"/>
<module load="false" name="default/whoami/1159970337127/war"/>
<module load="false" name="default/whoami/1160137570105/war"/>
<module name="default/whoami/1160702017783/war"/>
<module name="geronimo/servlets-examples-tomcat-cluster/1.1/war"/>
</attributes>
config.xml server 2:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================== -->
<!-- Warning - This XML file is re-generated by Geronimo when -->
<!-- changes are made to Geronimo's configuration, therefore -->
<!-- any comments added to this file will be lost. -->
<!-- Do not edit this file while Geronimo is running. -->
<!-- ======================================================== -->
<attributes xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1">
<module name="geronimo/rmi-naming/1.1/car">
<gbean name="RMIRegistry">
<attribute name="port">1199</attribute>
</gbean>
<gbean name="NamingProperties">
<attribute name="namingProviderUrl">rmi://0.0.0.0:1199</attribute>
</gbean>
<gbean name="DownloadedPluginRepos">
<attribute
name="repositoryList">http://people.apache.org/~ammulder/plugin-repository-list-1.1.txt</attribute>
<attribute name="userRepositories">[]</attribute>
</gbean>
</module>
<module name="geronimo/j2ee-server/1.1/car"/>
<module name="geronimo/j2ee-security/1.1/car">
<gbean name="JaasLoginServiceRemotingServer">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">4243</attribute>
</gbean>
<gbean name="JMXService">
<attribute name="protocol">rmi</attribute>
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">9999</attribute>
<attribute
name="urlPath">/jndi/rmi://0.0.0.0:1199/JMXConnector</attribute>
</gbean>
</module>
<module name="geronimo/axis/1.1/car"/>
<module name="geronimo/openejb/1.1/car">
<gbean name="EJBNetworkService">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">4202</attribute>
</gbean>
</module>
<module load="false" name="geronimo/j2ee-corba/1.1/car">
<gbean name="NameServer">
<attribute name="dbDir">var/cosnaming.db</attribute>
<attribute name="port">1050</attribute>
</gbean>
<gbean name="Server">
<attribute name="args">-ORBInitRef,
NameService=corbaloc::localhost:1050/NameService</attribute>
</gbean>
<gbean name="UnprotectedServer">
<attribute name="args">-ORBInitRef,
NameService=corbaloc::localhost:1050/NameService</attribute>
</gbean>
</module>
<module name="geronimo/system-database/1.1/car">
<gbean name="DerbyNetwork">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">1527</attribute>
</gbean>
</module>
<module name="geronimo/activemq-broker/1.1/car">
<gbean name="ActiveMQ.tcp.default">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">61617</attribute>
</gbean>
</module>
<module name="geronimo/activemq/1.1/car"/>
<module name="geronimo/tomcat/1.1/car">
<gbean name="TomcatResources"/>
<gbean name="TomcatEngine">
<attribute name="initParams">name=Geronimo
jvmRoute=worker2</attribute>
</gbean>
<gbean name="TomcatWebConnector">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">8081</attribute>
<attribute name="redirectPort">8444</attribute>
<attribute name="maxThreads">1000</attribute>
<attribute name="minSpareThreads">50</attribute>
<attribute name="maxSpareThreads">1000</attribute>
</gbean>
<gbean name="TomcatAJPConnector">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">8019</attribute>
<attribute name="redirectPort">8444</attribute>
</gbean>
<gbean name="TomcatWebSSLConnector">
<attribute name="host">0.0.0.0</attribute>
<attribute name="port">8444</attribute>
</gbean>
<gbean
name="geronimo/tomcat/1.1/car?ServiceModule=geronimo/tomcat/1.1/car,j2eeType=GBean,name=TomcatWebContainer">
<attribute name="catalinaHome">var/catalina</attribute>
</gbean>
</module>
<module name="geronimo/geronimo-gbean-deployer/1.1/car"/>
<module name="geronimo/j2ee-deployer/1.1/car">
<gbean name="WebBuilder">
<attribute
name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1
</attribute>
</gbean>
</module>
<module name="geronimo/openejb-deployer/1.1/car">
<gbean name="EJBBuilder">
<attribute name="listener">?name=TomcatWebContainer</attribute>
</gbean>
</module>
<module name="geronimo/client-deployer/1.1/car"/>
<module name="geronimo/axis-deployer/1.1/car"/>
<module load="false" name="geronimo/javamail/1.1/car">
<gbean name="SMTPTransport">
<attribute name="host">localhost</attribute>
<attribute name="port">25</attribute>
</gbean>
</module>
<module name="geronimo/sharedlib/1.1/car">
<gbean name="SharedLib">
<attribute name="classesDirs">var/shared/classes</attribute>
<attribute name="libDirs">var/shared/lib</attribute>
</gbean>
</module>
<module name="geronimo/tomcat-deployer/1.1/car"/>
<module name="geronimo/welcome-tomcat/1.1/car"/>
<module name="geronimo/webconsole-tomcat/1.1/car"/>
<module load="false" name="geronimo/uddi-tomcat/1.1/car"/>
<module name="geronimo/remote-deploy-tomcat/1.1/car"/>
<module name="geronimo/hot-deployer/1.1/car"/>
<module load="false" name="geronimo/SampleBankCSP/1.1/war"/>
<module load="false" name="default/SamplePostOfficeCSP/1-default/car"/>
<module load="false" name="geronimo/SamplePostOfficeCSP/1.1/war"/>
<module name="console/realm-persistLogin/1.0/car"/>
<module name="geronimo/iCareConsole/1.1/war"/>
<module name="geronimo/MetroBank/1.1/war"/>
<module name="geronimo/Symcorgui/1.1/war"/>
<module name="geronimo/MetroPhonePortal/1.1/war"/>
<module name="geronimo/SymcorMD/1.1/war"/>
<module load="false" name="default/whoami/1159900133326/war"/>
<module load="false" name="default/whoami/1159970337127/war"/>
<module load="false" name="default/whoami/1160137570105/war"/>
<module name="default/whoami/1160702017783/war"/>
<module name="geronimo/servlets-examples-tomcat-cluster/1.1/war"/>
</attributes>
Thanks,
Ryan Shows
Configuration Manager
Electronic Payment Services
Symcor Inc.
416-673-3824
[EMAIL PROTECTED]