我使用这个简单的配置在ubuntu 14中成功设置了HAProxy
listen rds-cluster
bind 10.0.0.204:3306
mode tcp
option mysql-check user ha_check
balance roundrobin
server mysql-1 ha1.xxxxxxx.ap-southeast-1.rds.amazonaws.com:3306 check weight 1 fall 2 fastinter 1000
server mysql-2 ha2.xxxxxxx.ap-southeast-1.rds.amazonaws.com:3306 check weight 1 fall 2 fastinter 1000
如果重新创建提供动态IP地址的实例,是否可以使用指向弹性IP地址的DNS绑定它?即便如此,它需要一个私人地址。所以我假设一个设置:
listen rds-cluster
bind haproxy.dns.com.au
option mysql-check user ha_check
balance roundrobin
server mysql-1 ha1.xxxxxxx.ap-southeast-1.rds.amazonaws.com:3306 check weight 1 fall 2 fastinter 1000
server mysql-2 ha2.xxxxxxx.ap-southeast-1.rds.amazonaws.com:3306 check weight 1 fall 2 fastinter 1000
但在使用命令mysql -h haproxy.dns.com.au -p'' -e "show variables like 'server_id'"
进行验证时,它没有响应。我明白我在做什么是错的。任何人都可以指导我想要实现的设置。提前谢谢