Need help with launching mySQL-proxy

Asked by Aleksandr-l1904

Need the following scheme:

* web interface connects to mysql proxy,
* mysql proxy connects to two databases, A and B.
* if either A or B is down, then the other database should be used for
all queries,
* if both A and B are up, then most queries should be sent to A, but
some queries [matching some regex pattern(s)] should be sent to B.

Question information

Language:
English Edit question
Status:
Answered
For:
MySQL Proxy Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Aleksandr-l1904 (aleksandr-litespan) said :
#1

Any advice ?

Revision history for this message
Kay Roepke (kay-roepke) said :
#2

take a look at the tutorial script named examples/tutorial-keepalive.lua.
note that in order to send queries to backend B, you have to have connected to that backend at least once as a result of action in the connect_server function, otherwise the proxy will not have a connection to B in its pool and changing the backend_ndx later would result in an error.

Can you help with this problem?

Provide an answer of your own, or ask Aleksandr-l1904 for more information if necessary.

To post a message you must log in.