tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ossi <los...@gmail.com>
Subject Re: Tomcat 6 clustering and engine's defaulthost
Date Mon, 17 Aug 2009 08:23:48 GMT
Oh, I think you got me wrong. As I said, by "non-existing name" I meant a
DNS name or definition in /etc/hosts file, something that is known to ie.
OS.
In all examples there were either "localhost" or "www.somesite.tld", so I
thought that it needs to be either DNS or /etc/hosts.

But it seem that as long as Engine's defaulthost has same name/character
string than Host element host has and that same name is used in all
instances of cluster
everything is fine as long there is ie. Apache httpd taking care of virtual
hosts, if there is any.

Anyway, below is the config of tomcat1. Tomcat2 has same config, but string
tomcat2 instead of tomcat1.

<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="off" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector address="tomcat1-private-address" port="8080"
protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

    <Connector address="tomcat1-private-address" port="8009"
protocol="AJP/1.3" redirectPort="8443" emptySessionPath="true" />

    <Engine name="Catalina" defaultHost="somestring"
jvmRoute="tomcat1">

        <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">

          <Manager className="org.apache.catalina.ha.session.DeltaManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"/>

          <Channel
className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership
className="org.apache.catalina.tribes.membership.McastService"
                        address="228.0.0.5"
                        port="45564"
                        frequency="500"
                        dropTime="3000"/>
            <Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                      address="tomcat-private-address1"
                      port="4200"
                      autoBind="100"
                      selectorTimeout="5000"
                      maxThreads="6"/>

            <Sender
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <Transport
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
            </Sender>
            <Interceptor
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
            <Interceptor
className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
          </Channel>

          <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=""/>
          <Valve
className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

          <ClusterListener
className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
          <ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>

      <Host name="somestring" appBase="webapps"

            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/home/tomcat/logs/"
               prefix="tomcat-private-address1_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>

      <Context path="/manager" debug="0" privileged="true"
       docBase="/home/tomcat/webapps/manager">
           <Valve className="org.apache.catalina.valves.RemoteAddrValve"
            allow="192.168.25.188"/>
      </Context>

      </Host>

    </Engine>
  </Service>
</Server>


Regards,
Ossi

PS: I tried to send this on last week, but noticed only now that this hit
some spam filter, let's see if it is accepted now, after slight changes.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message