OneProxy高可用

进程级高可用
/oneproxy/conf/proxy.conf 中增加如下配置
[oneproxy]
keepalive = 1

ps -ef|grep oneproxy
root 25927 1 0 13:59 ? 00:00:00 /opt/oneproxy/bin/oneproxy –defaults-file=/oneproxy/conf/proxy.conf
root 25929 25927 0 13:59 ? 00:00:00 /opt/oneproxy/bin/oneproxy –defaults-file=/oneproxy/conf/proxy.conf
root 25950 25859 0 14:00 pts/3 00:00:00 grep oneproxy

模拟故障:kill掉oneproxy

kill -9 25929 ; tail -f ../log/oneproxy.log

2017-09-04 14:00:58: (critical) chassis-unix-daemon.c:227: [angel] PID=25929 died on signal=9 (it used 21 kBytes max) … waiting 3min before restart
2017-09-04 14:01:00: (critical) plugin oneproxy 6.1.3 (Aug 23 2017) started
2017-09-04 14:01:00: (critical) Max Open File-descriptors = 65535
2017-09-04 14:01:00: (critical) Enterprise Register Code = OVKY-PHJQ-UUBP-JCNY-RDHV
2017-09-04 14:01:00: (critical) valid config checksum = 3347008714
2017-09-04 14:01:01: (critical) Welcome to OneProxy Comminity Edition!
2017-09-04 14:01:01: (critical) Ping backend (test@172.25.18.94:3316) success, mark it up!
2017-09-04 14:01:01: (critical) Ping backend (test@172.25.18.94:3326) success, mark it up!
2017-09-04 14:01:01: (critical) Ping backend (test@172.25.18.114:3316) success, mark it up!
2017-09-04 14:01:01: (critical) Ping backend (test@172.25.18.114:3326) success, mark it up!

发现oneproxy可用自动重启
ps -ef|grep oneproxy
root 25927 1 0 13:59 ? 00:00:00 /oneproxy/bin/oneproxy –defaults-file=/opt/oneproxy/conf/proxy.conf
root 25952 25927 0 14:01 ? 00:00:56 /oneproxy/bin/oneproxy –defaults-file=/opt/oneproxy/conf/proxy.conf
root 26114 26094 0 16:07 pts/1 00:00:00 grep oneproxy

双机高可用
如果操作系统崩溃或者硬件故障,进程级高可用就会失效。OneProxy 自带
的双机热备方案,当一台机器宕机之后,另一台机器就会接管VIP,继续提供服务。

如果OneProxy1 宕机之后,则会发生切换

OneProxy1 IP :172.25.18.94
OneProxy2 IP:172.25.18.114

OneProxy1 上的配置方式:
/oneproxy/conf/proxy.conf 中增加如下配置
remote-address = 172.25.18.114:4041
vip-address = 172.25.18.20/eth0:0

OneProxy2 上的配置方式:
/oneproxy/conf/proxy.conf 中增加如下配置
remote-address = 172.25.18.94:4041
vip-address = 172.25.18.20/eth0:0

双机热备方案测试
OneProxy2:
../oneproxy.service stop ; tail -20f ../log/oneproxy.log
2017-09-04 13:46:05: (critical) stop working port for oneproxy restart

OneProxy1:
tail -f ../log/oneproxy.log
2017-09-04 13:46:06: (critical) Ping remote admin port (172.25.18.114:4041) failed!

ip a|grep 172.25.18
inet 172.25.18.20/8 brd 10.255.255.255 scope global eth0:0
inet 172.25.18.94/24 brd 172.25.18.255 scope global bond0

双机热备的情况下:
一个oneProxy挂掉(2017-09-04 13:46:05)
2017-09-04 13:46:05: (critical) stop working port for oneproxy restart
另一个oneproxy能在秒级接管。
2017-09-04 13:46:06: (critical) Ping remote admin port (172.25.18.114:4041) failed!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值