haproxy的安装

下载地址:

http://www.haproxy.org/#down


文档地址:

http://www.haproxy.org/#doc1.6



下载好源码之后,解压:

安装 make install



cat /etc/test-sql.cfg

# This is a test configuration.

# It requires a mysql server running on local port 3306.


global

maxconn 500

pidfile /tmp/proxy.pid


defaults

contimeout 1000

clitimeout 5000

srvtimeout 5000

retries 1

option redispatch

mode tcp



listen test

bind :3307

mode tcp

balance roundrobin

option tcp-check

#option mysql-check user haproxy

server srv1 10.10.230.172:3306 check port 3306 inter 1000 fall 1

# server srv2 127.0.0.2:3306 check port 3306 inter 1000 fall 1

# server srv3 127.0.0.3:3306 check port 3306 inter 1000 fall 1

# server srv4 127.0.0.4:3306 check port 3306 inter 1000 fall 1



启动:

haproxy -f /etc/test-sql.cfg

[ root@10-10-157-43  tests]# ps -ef |grep pro

root 3177 728 0 19:59 pts/0 00:00:00 haproxy -f /etc/test-sql.cfg

root 3187 728 0 20:00 pts/0 00:00:00 grep pro



重新加载:

[ root@10-10-157-43  tests]# haproxy -f /etc/test-sql.cfg -sf 3177 &


转载请注明源出处 
QQ 273002188 欢迎一起学习 
QQ 群 236941212 
oracle,mysql,PG 相互交流

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25099483/viewspace-2112532/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25099483/viewspace-2112532/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值