You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim Lucia <ti...@yahoo.com> on 2006/04/04 20:49:36 UTC

Tomcat Clusters, private network for replication, and Oracle 8i JDBC driver

I have a 3-node cluster, running on Linux.  All 3 boxes are identical.

Eth0 - A class B network address - The 'public' interface for web traffic
(public in that it goes back out through httpd to the internet)

Eth1 - A class C network address - The 'private' interface for replication.
I.e.

            <Receiver
 
className="org.apache.catalina.cluster.tcp.ReplicationListener"
                tcpListenAddress="192.168.x.y"
                tcpListenPort="4009"
                tcpSelectorTimeout="100"
                tcpThreadCount="6"/>

Tomcat clustering all works fine.  The problem comes when I request a
connection from the connection pool to an Oracle 8i data source, like the
following:

  <Resource
    name="jdbc/dbname"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@hostname.company.com:1521:dbname"
    username="user"
    password="password"
    validationQuery="SELECT COUNT(*) FROM DUAL"
    initialSize="10"
    defaultCatalog="dbname"
    maxIdle="20"
    maxWait="5000"
    maxActive="50"/>

If I have the private network enabled for replication, then the Oracle thin
driver insists on trying to connect through this interface first.  This
happens on a class A network (10.0.x.y) as well as a class C network
(192.168.10.y).  It also happens if the OS happens to be W2K.  It will take
5 seconds and time out, and the connect through the class B address.  With
10 data sources (on Oracle) I get a connection pool startup time of 50+
seconds (minimum).

If I turn off the class C (or class A) private network and replicate on my
class B network, this problem does not happen.

Can anybody explain to me why this is the case?  Has anyone else seen this?
Has anyone else got this working as expected?

Should I even bother trying to keep the replication traffic on a private
network?  The boxes have 4 gig connections and so it seems like I should be
able to make use of the other 3.

Thanks,
Tim

P.s. Yes I know Oracle 8i pre-dates modern man and is no longer supported.
I'm on a long-range plan to move to MySQL.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat Clusters, private network for replication, and Oracle 8i JDBC driver

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
that sure does sound strange, you'd need a network sniffer to see what 
it tries to do
maybe oracle technet will have more info.

Filip

Tim Lucia wrote:
> I did change the metric on Windows when I first discovered this.  It made no
> difference.  Why would I *need* to add static routes -- when my machine's
> primary IP is 172.25.x.y and the database server is likewise 172.25.x.z?  I
> can't explain why *ONLY* the Oracle driver insists on trying the wrong path.
>
> Pinging the db server by name does not cause a 5 second delay, nor does
> telnet, ssh, wget, ... 
>
> Confused,
> Tim 
>
> -----Original Message-----
> From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
> Sent: Tuesday, April 04, 2006 3:49 PM
> To: Tomcat Users List
> Subject: Re: Tomcat Clusters, private network for replication, and Oracle 8i
> JDBC driver
>
> interesting, you might wanna play around with the route table and add some
> static routes for how you want your traffic to flow.
>
> Filip
>
> Tim Lucia wrote:
>   
>> I have a 3-node cluster, running on Linux.  All 3 boxes are identical.
>>
>> Eth0 - A class B network address - The 'public' interface for web 
>> traffic (public in that it goes back out through httpd to the 
>> internet)
>>
>> Eth1 - A class C network address - The 'private' interface for
>>     
> replication.
>   
>> I.e.
>>
>>             <Receiver
>>  
>> className="org.apache.catalina.cluster.tcp.ReplicationListener"
>>                 tcpListenAddress="192.168.x.y"
>>                 tcpListenPort="4009"
>>                 tcpSelectorTimeout="100"
>>                 tcpThreadCount="6"/>
>>
>> Tomcat clustering all works fine.  The problem comes when I request a 
>> connection from the connection pool to an Oracle 8i data source, like 
>> the
>> following:
>>
>>   <Resource
>>     name="jdbc/dbname"
>>     type="javax.sql.DataSource"
>>     driverClassName="oracle.jdbc.driver.OracleDriver"
>>     url="jdbc:oracle:thin:@hostname.company.com:1521:dbname"
>>     username="user"
>>     password="password"
>>     validationQuery="SELECT COUNT(*) FROM DUAL"
>>     initialSize="10"
>>     defaultCatalog="dbname"
>>     maxIdle="20"
>>     maxWait="5000"
>>     maxActive="50"/>
>>
>> If I have the private network enabled for replication, then the Oracle 
>> thin driver insists on trying to connect through this interface first.  
>> This happens on a class A network (10.0.x.y) as well as a class C 
>> network (192.168.10.y).  It also happens if the OS happens to be W2K.  
>> It will take
>> 5 seconds and time out, and the connect through the class B address.  
>> With 10 data sources (on Oracle) I get a connection pool startup time 
>> of 50+ seconds (minimum).
>>
>> If I turn off the class C (or class A) private network and replicate 
>> on my class B network, this problem does not happen.
>>
>> Can anybody explain to me why this is the case?  Has anyone else seen
>>     
> this?
>   
>> Has anyone else got this working as expected?
>>
>> Should I even bother trying to keep the replication traffic on a 
>> private network?  The boxes have 4 gig connections and so it seems 
>> like I should be able to make use of the other 3.
>>
>> Thanks,
>> Tim
>>
>> P.s. Yes I know Oracle 8i pre-dates modern man and is no longer supported.
>> I'm on a long-range plan to move to MySQL.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat Clusters, private network for replication, and Oracle 8i JDBC driver

Posted by "Darryl L. Miles" <da...@netbauds.net>.

Just a thought, you are using IP addresses for replication.  But 
hostname for Oracle, have you checked out local DNS issues with the 
jdbc:oracle:thin:@hostname.company.com:1521:dbname ?  Check the IP 
address records are correctly setup, and everyone listed is connectable 
and working.  Check all your local DNS caching servers are operational.  
However for DNS issues I would expect ping/ssh to be affected too.

Can you configure an IP address in the JDBC connection string ?

Do you have 2 default routes setup on your clustered boxes ?  You do not 
say in your original mail which directly connected network eth0 is on, I 
now read it as 172.25.x.y from your follow up.  What does your routing 
table look like.

One reason why the oracle driver uses eth0 over eth1 is that when the 
JDBC client opens the socket to connect it is not bound to any specific 
interface.  Where as with replication I'd guess the tcpListenAddress 
forces which physical card it will use.  Normal then the socket is 
auto-bound (within the kernel) it will choose the default address of the 
physical interface closest to the host (or gateway - if nto directly 
connected).

Have you setup any interface aliasing that might confuse the kernel.  
For example you have IP addresses in overlapping subnets on two physical 
interfaces in the same host ?

When the JDBC client does get connected to the SQL server, what does 
'netstat' show for the IP addresses of that connection ?  Is it using 
the  172.25.x.y:#### <--> 172.25.x.z :1521 as you expect ?

-- 
Darryl L. Miles



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat Clusters, private network for replication, and Oracle 8i JDBC driver

Posted by Tim Lucia <ti...@yahoo.com>.
I did change the metric on Windows when I first discovered this.  It made no
difference.  Why would I *need* to add static routes -- when my machine's
primary IP is 172.25.x.y and the database server is likewise 172.25.x.z?  I
can't explain why *ONLY* the Oracle driver insists on trying the wrong path.

Pinging the db server by name does not cause a 5 second delay, nor does
telnet, ssh, wget, ... 

Confused,
Tim 

-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
Sent: Tuesday, April 04, 2006 3:49 PM
To: Tomcat Users List
Subject: Re: Tomcat Clusters, private network for replication, and Oracle 8i
JDBC driver

interesting, you might wanna play around with the route table and add some
static routes for how you want your traffic to flow.

Filip

Tim Lucia wrote:
> I have a 3-node cluster, running on Linux.  All 3 boxes are identical.
>
> Eth0 - A class B network address - The 'public' interface for web 
> traffic (public in that it goes back out through httpd to the 
> internet)
>
> Eth1 - A class C network address - The 'private' interface for
replication.
> I.e.
>
>             <Receiver
>  
> className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                 tcpListenAddress="192.168.x.y"
>                 tcpListenPort="4009"
>                 tcpSelectorTimeout="100"
>                 tcpThreadCount="6"/>
>
> Tomcat clustering all works fine.  The problem comes when I request a 
> connection from the connection pool to an Oracle 8i data source, like 
> the
> following:
>
>   <Resource
>     name="jdbc/dbname"
>     type="javax.sql.DataSource"
>     driverClassName="oracle.jdbc.driver.OracleDriver"
>     url="jdbc:oracle:thin:@hostname.company.com:1521:dbname"
>     username="user"
>     password="password"
>     validationQuery="SELECT COUNT(*) FROM DUAL"
>     initialSize="10"
>     defaultCatalog="dbname"
>     maxIdle="20"
>     maxWait="5000"
>     maxActive="50"/>
>
> If I have the private network enabled for replication, then the Oracle 
> thin driver insists on trying to connect through this interface first.  
> This happens on a class A network (10.0.x.y) as well as a class C 
> network (192.168.10.y).  It also happens if the OS happens to be W2K.  
> It will take
> 5 seconds and time out, and the connect through the class B address.  
> With 10 data sources (on Oracle) I get a connection pool startup time 
> of 50+ seconds (minimum).
>
> If I turn off the class C (or class A) private network and replicate 
> on my class B network, this problem does not happen.
>
> Can anybody explain to me why this is the case?  Has anyone else seen
this?
> Has anyone else got this working as expected?
>
> Should I even bother trying to keep the replication traffic on a 
> private network?  The boxes have 4 gig connections and so it seems 
> like I should be able to make use of the other 3.
>
> Thanks,
> Tim
>
> P.s. Yes I know Oracle 8i pre-dates modern man and is no longer supported.
> I'm on a long-range plan to move to MySQL.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat Clusters, private network for replication, and Oracle 8i JDBC driver

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
interesting, you might wanna play around with the route table and add 
some static routes for how you want your traffic to flow.

Filip

Tim Lucia wrote:
> I have a 3-node cluster, running on Linux.  All 3 boxes are identical.
>
> Eth0 - A class B network address - The 'public' interface for web traffic
> (public in that it goes back out through httpd to the internet)
>
> Eth1 - A class C network address - The 'private' interface for replication.
> I.e.
>
>             <Receiver
>  
> className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                 tcpListenAddress="192.168.x.y"
>                 tcpListenPort="4009"
>                 tcpSelectorTimeout="100"
>                 tcpThreadCount="6"/>
>
> Tomcat clustering all works fine.  The problem comes when I request a
> connection from the connection pool to an Oracle 8i data source, like the
> following:
>
>   <Resource
>     name="jdbc/dbname"
>     type="javax.sql.DataSource"
>     driverClassName="oracle.jdbc.driver.OracleDriver"
>     url="jdbc:oracle:thin:@hostname.company.com:1521:dbname"
>     username="user"
>     password="password"
>     validationQuery="SELECT COUNT(*) FROM DUAL"
>     initialSize="10"
>     defaultCatalog="dbname"
>     maxIdle="20"
>     maxWait="5000"
>     maxActive="50"/>
>
> If I have the private network enabled for replication, then the Oracle thin
> driver insists on trying to connect through this interface first.  This
> happens on a class A network (10.0.x.y) as well as a class C network
> (192.168.10.y).  It also happens if the OS happens to be W2K.  It will take
> 5 seconds and time out, and the connect through the class B address.  With
> 10 data sources (on Oracle) I get a connection pool startup time of 50+
> seconds (minimum).
>
> If I turn off the class C (or class A) private network and replicate on my
> class B network, this problem does not happen.
>
> Can anybody explain to me why this is the case?  Has anyone else seen this?
> Has anyone else got this working as expected?
>
> Should I even bother trying to keep the replication traffic on a private
> network?  The boxes have 4 gig connections and so it seems like I should be
> able to make use of the other 3.
>
> Thanks,
> Tim
>
> P.s. Yes I know Oracle 8i pre-dates modern man and is no longer supported.
> I'm on a long-range plan to move to MySQL.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org