我下载的Haproxy配置文件backend app这一块怎么用listen写法

来源:2-10 组建双机热备的MyCat集群-构建高可用的MyCat集群

慕圣1477345

2019-06-09

#---------------------------------------------------------------------

main frontend which proxys to the backends

#---------------------------------------------------------------------
listen admin_stats
bind 0.0.0.0:4001
mode http
stats uri /dbs
stats realm Global\ statistics
stats auth admin:123456
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js

use_backend static          if url_static
default_backend             app

#---------------------------------------------------------------------

static backend for serving up images, stylesheets and such

#---------------------------------------------------------------------
backend static
balance roundrobin
server static 127.0.0.1:4331 check

#---------------------------------------------------------------------

round robin balancing between the various backends

#---------------------------------------------------------------------
backend app
balance roundrobin
server mycat_1 47.101.33.118:8066 check port 8066 weight 1 maxconn 2000
server mycat_2 47.103.200.150:8066 check port 8066 weight 1 maxconn 2000

写回答

3回答

神思者

2019-06-09

按照视频里的方式写配置文件

0
0

慕圣1477345

提问者

2019-06-09

这样写报错

listen proxy-mysql

    bind 0.0.0.0:3306

    mode tcp

    balance     roundrobin

    option tcplog

    server  mycat_1 47.101.33.118:8066 check port 8066 weight 1 maxconn 2000

    server  mycat_2 47.103.200.150:8066 check port 8066 weight 1 maxconn 2000

    option tcpka

//img.mukewang.com/szimg/5cfc88bc0001daaf10360131.jpg

0
0

慕圣1477345

提问者

2019-06-09

backend app 这一块怎么写listen proxy-mysql bind 0.0.0.0:3306 这样写报错!

0
0

MySQL数据库集群-PXC方案,解决数据库领域疑难杂症

学习PXC,打造高价值的MySQL集群

511 学习 · 217 问题

查看课程