Forum Discussion

Fabrizio_Chiava's avatar
Fabrizio_Chiava
Icon for Nimbostratus rankNimbostratus
Aug 06, 2010

loggin SQL transaction

Hello everybody,

 

I have got a DB architecture with web server that open SQL session to DB in other part of network and write data on DB. I would to load balance this transaction with BIGIP and I would to know if it's possible to configure the log for capture the SQL (or Oracle, or MySql, or other) transaction (f.i. webserver1 is connected to DB1).

 

It is possible to do that?

 

 

Thanks in advance

 

Best regards

 

Fabrizio.

 

4 Replies

  • Hi Fabrizio,

     

     

    You can do layer 4 load balancing of SQL connections using LTM. Most people use a single active pool member at a time and a simple iRule to persist to the currently active server:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/SingleNodePersistence.html

     

     

    If you're looking to split reads and writes to separate servers or pools, it gets more complicated:

     

    http://devcentral.f5.com/Forums/tabid/1082223/asg/50/showtab/groupforums/aff/5/aft/2085/afv/topic/Default.aspx

     

     

    Aaron
  • Hi Aaron,

     

    thanks a lot for your reply. In first, I would to ask you, is this iRule usefull to load balance the transactions between web srv and DB? Could I perform it with a simple vs (FastL4 or Standard) and default pool with DBs?

     

     

    Finally, Could I log this sessions on the log file?

     

     

    Thanks in advance

     

    Best Regards

     

    Fabrizio.
  • The iRule would ensure that only one DB server is used at a time. If that selected server goes down, then all new connections would go to the second server even after the first one comes back up. You should be able to use it on a Performance L4 / FastL4 VS. You could add debug logging which records the client IP and server with the persistence record. I haven't tested the logging, but something like this should work:

    
    when CLIENT_ACCEPTED {
       persist uie 1
       log local0. "[IP::client_addr] -> [persist uie lookup 1]"
    }
    

    Aaron
  • One query ! Is it better to use iRule or Priority group here ? cause using irule will mean that every query from web > db needs to be processed against the irule but in other case it is not . I never compared both methods but i use priority groups ..

     

     

    Please suggest.