Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build mysql-proxy for CentOS 6.8

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following content mainly brings you CentOS 6.8.How to build mysql-proxy, the knowledge mentioned here, which is slightly different from books, is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing, hoping to bring help to the majority of readers.

CentOS 6.8 builds mysql-proxy to achieve read-write separation:

Download URL:

Http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-Proxy

Note:

1. 10.0.1.2 is mysql-proxy CVM ip

2. The effect is 1 write and 2 reads

Tar zxfv mysql-proxy-0.8.5-linux-el6-x86-64bit.tar.gz-C / spacemv / space/mysql-proxy-0.8.5-linux-el6-x86-64bit / space/mysql-proxymkdir / space/mysql-proxy/logscp-rv / space/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua / space/mysql-proxy/vi / space/mysql-proxy/rw-splitting.lua

If not proxy.global.config.rwsplit then

Proxy.global.config.rwsplit = {

Min_idle_connections = 1, (default is 4, that is, read-write separation occurs only if there are more than 4)

Max_idle_connections = 1, (default is 8)

Is_debug = false}

End

: wq

Vi / space/mysql-proxy/mysql-proxy.cnf

[mysql-proxy]

Proxy-address=10.0.1.2:4040

Proxy-backend-addresses=10.0.1.3

Proxy-read-only-backend-addresses=10.0.1.4

Proxy-read-only-backend-addresses=10.0.1.5

Proxy-lua-script=/space/mysql-proxy/rw-splitting.lua

Log-file=/space/mysql-proxy/logs/mysql-proxy.log

Log-level=info

Daemon=true

: wq

Chmod 0660 / space/mysql-proxy/mysql-proxy.cnf/space/mysql-proxy/bin/mysql-proxy-- defaults-file=/space/mysql-proxy/mysql-proxy.cnfps-ef | grep mysql-proxynetstat-nplt | grep 4040

The customs service is available through the kill-9 process number.

Client access:

Mysql-h 10.0.1.2-P 4040-u aa-pallexxxx'

For the above about CentOS 6.8 how to build mysql-proxy, if you need to know more, you can continue to follow our industry promotion, if you need to get professional answers, you can contact the pre-sales and after-sales on the official website. I hope this article can bring you some knowledge updates.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report