当前位置:网站首页>MySQL read-write separation mysql-proxy deployment
MySQL read-write separation mysql-proxy deployment
2022-08-02 05:24:00 【hzsnone】
0x01 Introduction
mysql-proxy is the mysql middleware service officially provided by mysql. Several mysql-clients can be connected to the upstream, and several mysql-servers can be connected to the back-end.
It uses the mysql protocol, and any upstream using mysql-client can migrate to mysql-proxy without modifying any code.
The most basic usage of mysql-proxy is as an intermediate layer for request interception and request transfer:
mysql-proxy allows users to specify Lua scripts to intercept requests, analyze and modify requests, and it also allows users toSpecifies the result returned by the Lua script to the server.
0x02 Purpose
sql interception and modification
performance analysis and monitoring
read-write separation
request routing
0x03 Deployment Process
Binary package installation
wget https://downloads.mysql.com/archives/get/file/mysql-proxy-0.8.5-linux-el6-x86-64bit.tar.gz
tar zxf mysql-proxy-0.8.5-linux-el6-x86-64bit.tar.gz
mv mysql-proxy-0.8.5-linux-el6-x86-64bit /usr/local/mysql-proxy
cd /usr/local/mysql-proxy
mkdir log
mkdir conf
#Configuration file creation
cd conf
vim mysql-proxy.conf
[mysql-proxy]###If it is an ordinary user, this option is removeduser=rootdaemon=truekeepalive=trueplugins=proxy,admin###Log levellog-level=infolog-file=/usr/local/mysql-proxy/log/mysql-proxy.log###Local ip addressproxy-address=0.0.0.0:9196##backend master note addressesproxy-backend-addresses=192.168.1.11:3306##admin-address=104.137.27.4:9197proxy-read-only-backend-addresses=192.168.1.21:3306IP and port of #proxy management user admin###The following three parameters must be set, otherwise the mysql-proxy service cannot be startedadmin-username=mysql_proxy_useradmin-password=456123###admin's lua script address;admin-lua-script=/usr/local/mysql-proxy/lib/mysql-proxy/lua/admin.lua0X04 start
/usr/local/mysql-proxy/bin/mysql-proxy --defaults-file=/usr/local/mysql-proxy/conf/mysql-proxy.conf边栏推荐
猜你喜欢
随机推荐
深蓝学院-视觉SLAM十四讲-第七章作业
基于sysbench工具的压力测试---MyCat2.0+MySql架构
科研笔记(八) 深度学习及其在 WiFi 人体感知中的应用(下)
shell中常用的基础命令
SCI writing strategy - with common English writing sentence patterns
其他语法和模块的导出导入
侦听器watch及其和计算属性、methods方法的总结
this指向问题
《2022年中国网络安全市场全景图》
SCI期刊最权威的信息查询步骤!
Go的安装使用(一)
生物识别学习资源推荐
腾讯云+keepalived搭建云服务器主备实践
单目三维目标检测之CaDDN论文阅读
asyncawait和promise的区别
Autowired注解与Resource注解的区别
吴恩达机器学习系列课程笔记——第六章:逻辑回归(Logistic Regression)
SLSA 框架与软件供应链安全防护
ffmpeg推流USB到rtsp
Deep Blue Academy - Fourteen Lectures of Visual SLAM - Chapter 4 Homework







![[Win11] PowerShell cannot activate Conda virtual environment](/img/53/464ffb5ef80ce8f6ee19e9ea96c159.png)

