MySQL Proxy read/write splitting practice

Source: Internet
Author: User

First use one as read/write, and one as read-only

Mysql-proxy -- proxy-address = 192.168.210.20.: 3306 -- proxy-read-only-backend-addresses = 192.168.210.132: 3306 -- proxy-backend-addresses = 192.168.210.131: 3306 -- proxy-lua-script =/usr/local/share/mysql-proxy/rw-splitting.lua>/var/log/mysql-proxy/mysql-proxy.log &

Currently, one read/write instance is used. The other two are read-only instances.

Mysql-proxy -- proxy-address = 192.168.210.20.: 3306 -- proxy-read-only-backend-addresses = 192.168.210.131: 3306 -- proxy-read-only-backend-addresses = 192.168.210.132: 3306 -- proxy-backend-addresses = 192.168.210.134: 3306 -- proxy-lua-script =/usr/local/share/mysql-proxy/rw-splitting.lua>/var/log/mysql-proxy/mysql-proxy.log &

Summary

1. In case of different sessions of the same IP address, the Proxy will be counted as a client, that is, each IP address is a CLIENT, rather than the actual number of connections.

2. the parameter that controls the triggering of read/write splitting is located in/usr/local/share/mysql-proxy/rw-splitting.lua script min_idle_connections. when the number of connections on the client exceeds this value, Proxy read/write splitting starts. (currently, the max_idle_connections parameter has no special effect)

3.-proxy-read-only-backend-addresses can be added. However, the test is always connected to the first added server. Automatic request distribution is not performed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.