Mysql-proxy of MySQL read-write separation operation

Source: Internet
Author: User
Tags lua

Common reading and Writing methods

Internal implementation based on program code

Selecting categories in code according to select, insert, which is often used in production, is the most efficient, but cumbersome for developers. Architecture cannot be flexibly adjusted

Middleware-based read-write separation:

Mysql-proxy, Ameba, Atlas, Cobar, TDDL

Build Mysql-proxy

Download: http://downloads.mysql.com/archives/proxy/Select Linux gentic and compile the binaries.

Tar zxf mysql-proxy-0.8.5-linux-glibc2.3-x86-64bit.tar.gz-c/usr/local/
Ln-s Mysql-proxy-0.8.5-linux-glibc2.3-x86-64bit/mysql-proxy

Sometimes start Mysql-proxy file limit errors, you can appropriately increase the opening of the file settings

Ulimit–n 10240

To open a proxy:

/usr/local/mysql-proxy/bin/mysql-proxy-p 192.168.88.123:3306-b 192.168.88.121:3306-r 192.168.88.122:3306-r 192.168.88.124:3306-s/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua--daemon

# #mysql-proxy Read and write separation is implemented based on LUA scripting

##-p Specifies the IP and port of the binding,-B write,-r specifies read,-s specifies the script

Tip: The above two steps can be written in the/ect/rc.local, so that the boot from the execution

Note: The main library is down in Mysql-proxy and is not available from the library. But Atlas can compensate for this flaw.

Mysql-proxy of MySQL read-write separation operation

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.