Mysql-proxy First Experience

Source: Internet
Author: User
Tags lua

Originally to test the Atlas, unfortunately there is no 32 version, and the two are extremely similar, but the internal implementation is different, so familiar with Mysql-proxy as an alternative.


Environment: Tested on a single machine due to condition constraints

rw:192.168.137.129:3306

ro:192.168.137.129:3307

viproxy:192.168.137.129:3814

viadmin:192.168.137,129:4041


Configuration file: myproxy.cnf

[Mysql-proxy]

proxy-address=0.0.0.0:38141

Plugins = Admin,proxy

Admin-address = 0.0.0.0:4041

Admin-username=admin

Admin-password=admin

Admin-lua-script=/usr/local/mysqlproxy/lib/mysql-proxy/lua/admin.lua


proxy-backend-addresses=192.168.137.129:3306

proxy-read-only-backend-addresses=192.168.137.129:3307

Proxy-lua-script=/usr/local/mysqlproxy/share/doc/mysql-proxy/rw-splitting.lua


Log-file=/usr/local/mysqlproxy/log/mysql-proxy.log

Log-level=debug

Daemon=true

Keepalive=true


Start: Enter the client directory

./bin/mysql-proxy--DEFAULTS-FILE=/ETC/MYPROXY.CNF


To view the current administrative actions:

./bin/mysql-h 192.168.137.129-p 4041-uadmin-p

SELECT * from Backends; View the status of the current individual SQL nodes


Manipulating SQL nodes from a proxy port

./bin/mysql-h 192.168.137.129-p 38141-u test-p

#之前已经通过grant create a SQL user that can be used on the SQL node

#进入后就能像操作sql the same operation.


Note: When viewing the management node, it was found that the query could not be automatically polled and was later found to be the configured minimum node connection number in the Lua RW script

is 4, and my test and only opened two connections, so you can not poll query, change over can




This article is from the PHP Learning notes blog, so be sure to keep this source http://jxw7733.blog.51cto.com/6389174/1693173

Mysql-proxy First Experience

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.