2000时,atlas会提示I have no server backend,closing connection。判断应为mysql不能及时提供空闲连接导致,但atlas并未出现任何瓶颈。但是,atlas自身没有断开mysql连接的设置,完全依赖于mysql自身的超时时间。
其读写分离策略是除了完全的读请求,其余的都会将请求发给主库。
测试脚本:
#!/bin/bash
#***For pressure test Atlas***
date +"%H:%M:%S"
for ((i=0;i<1500;i++));do
{
num=`echo $RANDOM`
mysql -ushanks -p51cto -h192.168.122.100 -P8306 zabbix -e "insert into test_atlas values(\"${num}\")"
} &
done
date +"%H:%M:%S"
配置文件:
[mysql-proxy]
plugins = admin,proxy
admin-username = admin
admin-password = DD@123
admin-lua-script = /usr/local/mysql-proxy/lib/mysql-proxy/lua/admin.lua
proxy-backend-addresses = 172.16.220.242:3306
proxy-read-only-backend-addresses = 172.16.220.243:3306@2
daemon = true
keepalive = true
event-threads = 4
log-level = message
log-path = /usr/local/mysql-proxy/log
instance = test
proxy-address = 0.0.0.0:8306
admin-address = 0.0.0.0:8307
min-idle-connections = 128
#tables = person.mt.id.3
#pwds = 8Z9V7iLZoR0=
charset = utf8
本文出自 “目标:印度” 博客,请务必保留此出处http://shunzi115.blog.51cto.com/5184443/1825940
采用Atlas mysql 读写分离工具
标签:server mysql 文章
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:http://shunzi115.blog.51cto.com/5184443/1825940