89286

89286



Capturing a Connection with connect_server o

When the proxy accepts a connection from a MySQL Client, the

connect_server () function is called.

There are no arguments to the function, but you can use and if necessary manipulate the information in

the proxy.connection table, which is unique to each Client session.

For example, if you have multiple backend servers, you can specify which server that connection

should use by setting the value of proxy.connection.backend_ndx to a valid server number. The

following codę chooses between two servers based on whether the current time in

minutes is odd or

even:

function connect_server ()

print("--> a Client really want3 to talk to a server")

if (tonumber(os.date("%M")) % 2 == 0) then

proxy.connection.backend_ndx - 2

print("Choosing backend 2")

else

proxy.connection.backend_ndx - 1 print("Choosing backend 1") end

print("Using " ..

proxy.global.backends[proxy.connection.backend_ndx).dst.name) end

This example also displays the IP address/port combination by accessing the information from the

intemal proxy.global.backends table.



Wyszukiwarka

Podobne podstrony:
section 2.5 and [1]. Mnesia is known to have problems with performance degradation when the database
To perform a whole database backup when the database is open: 1.    Connect RMAN to t
Crochet Borders76 CROCHET SYMBOLS Chain stitch. When the symbol for a single Chain stitch ((*■—^)) i
GTID modę and mysql_upgrade. Prior to MySQL 5.6.7, mysql_upgrade could not connect to a MySQL Server
SCI Transport Connections in MySQL Cluster [sci] sections in the config.ini file explicitly define S
k-la When .1 sufficien: quannty hasbeen prupared, space them apart with a needle inserted through th
Start the Nessus server when Windows boots When enabled, the Nessus server will be automatically sta
When a sufficient quaniity hasbeen prepared, space them apart with a needle inserted through the sma
f9 5 lnbox Setup Wizard Select the information services(s] that you want to use with Microsoft Excha
Fig Earth Wand with flint Water Wand with shell Figurę 17 The Wand or Rod Air Wand with feathcrs Ti
00116 09a02659b05297f786ef7e850f9912 116 McWilliams smali, so the first term of [10] does have an
00162 ?9b949846ac8ec47085cc44f65d6360 163 Economic Control Chart Models with Cycle Duration Constra
00431 ?2bd2b6c7f7803f642438372603e664 436 Russell between dynami cal Systems and time senes analysi
00453 ?960d11ee48a490cc71f653328fb9cc 458 Russell set. Especially when the retrace "pattem&quo
Don’t miss ANTON STROUrSDEAD MAUER When the paranormal raises its otherworldly head in New York City

więcej podobnych podstron