Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using HA Proxy HA-Proxy version 1.4.18 2011/09/16 I am trying to insert the following into /etc/init.d/haproxy.cfg file

# 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

I get the following error:

[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]

Could you please tell me what is wrong with the code? Thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

haproxy 1.4 does not support the store keyword, plus some other things you have in there.

either upgrade to the latest 1.5 version or consult the correct documentation for your version.

share|improve this answer
    
Thank you @longneck –  Vladimir Sep 13 '12 at 17:53
    
also, do you know anything about upstart scripting. I am trying to keep haproxy alive in case it dies out.<br /> I heard respawn would do that for me –  Vladimir Sep 13 '12 at 17:56
    
that would be a separate question. however, i suggest that you do some initial research before asking that question. –  longneck Sep 13 '12 at 20:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.