TEIID and Load Balancing
gioppoluca Sep 26, 2012 6:05 PMCan you explain a bit more how to load balance a clustered TEIID installation?
Use case:
JBoss AS 7.1.1 + TEIID 8.1
JBoss clustered (profile HA and dedicated server group) so two different hosts are there:
Was it a simple war with a third host with http + mod_cluster I could achieve load balancing.
Since I'm connecting to a VDB using JDBC How do I load balance (which is the equivalent option of mod_cluster for http?)
It seems that the TEIID connector is able to do something on itself, but is not clear to me.
Do I have to use a load balancer (let's say nginx to do the pure tcp balancing and pointing the connector to the balancer address)?
Am I assured that caching is consistent on all nodes and that all will work well and scale for performance and fail over?
In the docs there is this example of data source for load balancing:
What {host} do we have to use since there will be at least two nodes in the cluster?
<datasources>
<datasource jndi-name=
"java:/teiidDS"
pool-name=
"teiidDS"
>
<connection-url>jdbc:teiid:{vdb}
@mm
:
//{host}:31000</connection-url>
<driver>teiid</driver>
<pool>
<prefill>
false
</prefill>
<use-strict-min>
false
</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
<check-valid-connection-sql>SET NEWINSTANCE TRUE</check-valid-connection-sql>
</pool>
<security>
<user-name>{user}</user-name>
<password>{password}</password>
</security>
</datasource>
<drivers>
<driver name=
"teiid"
module=
"org.jboss.teiid.client"
>
<driver-
class
>org.teiid.jdbc.TeiidDriver</driver-
class
>
<xa-datasource-
class
>org.teiid.jdbc.TeiidDataSource</xa-datasource-
class
>
</driver>
</drivers>
</datasources>
There is also this statement:
"You may also choose to use an external tcp load balancer, such as haproxy. The Teiid driver/DataSource should then typically be configured to just use the single host/port of your load balancer"
Is it possible to have a more "prescriptive" way of setting the cluster (not may but must)?
The option of the data source seems nice and easy (no third haproxy/nginx server around) but I get confused by the first statment:
jdbc:teiid:<vdb-name>
@mm
:
//host1:31000,host1:31001,host2:31000;version=2
The comma separated host is not present in the datasource so ...
Thanks
Luca