Mysql中间件代理 Atlas
来源:互联网 发布:现货股票行情的软件 编辑:程序博客网 时间:2024/06/05 20:10
1
2
3
4
5
6
7
# yum -y install openssl openssl-devel
# wget https://github.com/Qihoo360/Atlas/releases/download/2.1/Atlas-2.1.el6.x86_64.rpm
# rpm -ivh Atlas-2.1.el6.x86_64.rpm
# cd /usr/local/mysql-proxy/conf/
# /usr/local/mysql-proxy/bin/encrypt 123456
/iZxz+0GRoA=
1
2
3
4
5
6
7
8
9
10
11
12
13
[mysql-proxy]
admin-username = admin
admin-password = admin
proxy-backend-addresses = 192.168.1.231:3306
proxy-read-only-backend-addresses = 192.168.1.227:3306,192.168.1.228:3306
pwds = root:/iZxz+0GRoA=
daemon = true
keepalive = true
event-threads = 8
log-level = message
log-path = /usr/local/mysql-proxy/log
proxy-address = 0.0.0.0:1234
admin-address = 0.0.0.0:2345
1
2
3
4
5
6
2014-10-29 11:12:11: (message) mysql-proxy 0.8.2 started - instance: test
2014-10-29 11:12:11: (message) proxy listening on port 0.0.0.0:1234
2014-10-29 11:12:11: (message) added read/write backend: 192.168.1.231:3306
2014-10-29 11:12:11: (message) added read-only backend: 192.168.1.227:3306
2014-10-29 11:12:11: (message) chassis-unix-daemon.c:138: [angel] we try to keep PID=29643 alive2014-10-29 11:12:11: (message) added read-only backend: 192.168.1.228:3306
2014-10-29 11:12:11: (message) chassis-event-thread.c:235: starting 8 threads
1
2
3
4
5
# cd /usr/local/src/
# wget http://www.keepalived.org/software/keepalived-1.2.13.tar.gz
# tar -zxvpf keepalived-1.2.13.tar.gz
# cd keepalived-1.2.13
# ./configure --prefix=/usr/local/keepalived && make && make install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! Configuration File for keepalived
global_defs {
router_id LVS_DEVEL
}
vrrp_script Monitor_Atlas {
script "/usr/local/scripts/monitor_atlas.sh"
interval 2
weight 2
}
vrrp_instance VI_1{
state MASTER
interface eth0
virtual_router_id 51
mcast_src_ip 192.168.1.12
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass password_123
}
track_script {
Monitor_Atlas
}
virtual_ipaddress {
192.168.1.230
}
}
1
2
3
4
5
6
7
8
9
#!/bin/bash
if [ $(ps -ef |grep 'mysql-proxy' |grep -v 'grep' |wc -l) -eq "0" ];then
/usr/local/mysql-proxy/bin/mysql-proxyd test start
sleep 5
if [ $(ps -ef |grep 'mysql-proxy' |grep -v 'grep' |wc -l) -eq "0" ];then
killall -9 keepalived
service network restart
fi
fi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! Configuration File for keepalived
global_defs {
router_id LVS_DEVEL
}
vrrp_script Monitor_Atlas {
script "/usr/local/scripts/monitor_atlas.sh"
interval 2
weight 2
}
vrrp_instance VI_1{
state BACKUP
interface eth0
virtual_router_id 51
mcast_src_ip 192.168.1.81
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass password_123
}
track_script {
Monitor_Atlas
}
virtual_ipaddress {
192.168.1.230
}
}
1
2
3
4
5
6
7
8
9
#!/bin/bash
if [ $(ps -ef |grep 'mysql-proxy' |grep -v 'grep' |wc -l) -eq "0" ];then
/usr/local/mysql-proxy/bin/mysql-proxyd test start
sleep 5
if [ $(ps -ef |grep 'mysql-proxy' |grep -v 'grep' |wc -l) -eq "0" ];then
killall -9 keepalived
service network restart
fi
fi
0 0
- Mysql中间件代理 Atlas
- Mysql代理中间件 Atlas 安装和配置
- mysql中间件Atlas安装
- MySQL中间件-Atlas
- mysql 中间件atlas性能测试
- Mysql中间件Atlas的安装
- MySQL中间件Atlas快速安装
- mysql代理之Atlas
- mysql中间件-Qihoo360 Atlas MySQL Proxy
- MYSQL中间件研究(Atlas,Cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- Mysql中间件研究(Atlas,cobar,TDDL)
- mysql中间件研究(Atlas,cobar,TDDL)
- [Unity官方文档翻译]Primitive and Placeholder Objects Unity原生3D物体教程
- android从零单排之openFileOutput()方法学习
- 2013 南京站现场赛 --hdu4803Poor Warehouse Keeper
- java智力拼图小游戏
- LeetCode 56 Merge Intervals
- Mysql中间件代理 Atlas
- 11款最轻量级的CSS框架
- mysql 联合索引> 和 order by 不走 索引 慎用
- PlayerPrefs 位置 unity
- 當前日期為第几周
- 计算N内点对互质个数
- jquery实现遮罩层
- AppStore提交出错 ITMS-90034错误application loader的方法提交的以及上线的流程
- PHP正则非字母非汉字