温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

haproxy的安装

发布时间:2020-08-18 20:17:08 来源:ITPUB博客 阅读:139 作者:psufnxk2000 栏目:MySQL数据库
下载地址:

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 相互交流
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI