HA Proxy Stick-table和tcp-connection配置

时间:2012-09-13 15:38:36

标签: haproxy

我正在使用HA代理HA-Proxy版本1.4.18 2011/09/16我试图将以下内容插入/etc/init.d/haproxy.cfg文件

# Use General Purpose Couter (gpc) 0 in SC1 as a global abuse counter
# Monitors the number of request sent by an IP over a period of 10 seconds
stick-table type ip size 1m expire 10s store gpc0,http_req_rate(10s)
tcp-request connection track-sc1 src
tcp-request connection reject if { src_get_gpc0 gt 0 }

# Table definition  
stick-table type ip size 100k expire 30s store conn_cur(3s)
# Allow clean known IPs to bypass the filter
tcp-request connection accept if { src -f /etc/haproxy/whitelist.lst }
# Shut the new connection as long as the client has already 10 opened
tcp-request connection reject if { src_conn_cur ge 10 }
tcp-request connection track-sc1 src

我收到以下错误:

[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:36] : stick-table: unknown argument 'store'.
[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:37] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy'
[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:38] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy'
[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:41] : stick-table: unknown argument 'store'.
[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:43] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy'
[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:45] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy'
[ALERT] 256/113143 (4627) : parsing [/etc/haproxy/haproxy.cfg:46] : unknown argument 'connection' after 'tcp-request' in proxy 'http_proxy'
[ALERT] 256/113143 (4627) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg 
[WARNING] 256/113143 (4627) : Proxy 'http_proxy': in multi-process mode, stats will be limited to process assigned to the current request.
[ALERT] 256/113143 (4627) : Fatal errors found in configuration.
[fail]
您能否告诉我代码有什么问题?

1 个答案:

答案 0 :(得分:4)

在数据表中存储数据仅出现在haproxy 1.5-dev中,而不是1.4。你应该尝试最新的1.5-dev12。顺便说一句,如果你是1.4,你应该升级到1.4.22,这可以解决自你一岁的1.4.18以来的一些错误。

相关问题