1 Reply Latest reply on Sep 27, 2012 9:42 AM by rareddy

    TEIID and Load Balancing

    gioppoluca

      Can 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

        • 1. Re: TEIID and Load Balancing
          rareddy

          Luca,

           

          There is no one prescriptive way. Multiple host/port combinations on the URL is our built in way, that may satisfy your needs. HAProxy is another option, where if you have nodes are coming in and going out all the time then  you have single place you can configure all the node information, instead of at every single client.

           

          As per clustering the AS7 just follow the AS7 documents. Also note the installtion of Teiid in Domain mode is different check the Admin Guide. I would very much like you to test this out and give us feed back on domain mode.

           

          Thanks.

           

          Ramesh..