The log also said:
May 27 14:39:11 localhost haproxy[1278]: Proxy ft_postfix started.
May 27 14:39:11 localhost haproxy[1278]: Server ft_postfix/postfix01 is
DOWN, reason: Layer7 invalid response, info: "220-mail.mydomain.com
ESMTP Postfix (Ubuntu)", check duration: 1ms. 0 active and 0 backup
servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
May 27 14:39:11 localhost haproxy[1278]: proxy ft_postfix has no server
available!
On 05/27/2013 02:34 PM, Vit Dua wrote:
I have used proxy protocol for SMTP as this tutorial:
http://blog.exceliance.fr/2012/06/30/efficient-smtp-relay-infrastructure-with-postfix-and-load-balancers/
HAProxy config:
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
defaults
log global
option dontlognull
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen ft_postfix 0.0.0.0:25
mode tcp
balance roundrobin
option tcplog
option smtpchk HELO haproxy01.mydomain.com
server postfix01 X.X.X.X:10000 send-proxy #check
It worked successfully.
I wanted to do smtpchk so that I added to the config:
server postfix01 X.X.X.X:10000 send-proxy check
Then the log told that the server was down though it is not:
May 27 14:07:51 localhost haproxy[6890]: Proxy ft_postfix started.
May 27 14:07:51 localhost haproxy[6890]: Server ft_postfix/postfix01
is DOWN, reason: Initializing, check duration: 0ms. 0 active and 0
backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
May 27 14:07:51 localhost haproxy[6890]: proxy ft_postfix has no
server available!
I also tried
server postfix01 X.X.X.X:10000 check send-proxy
but the result is the same.
I could do smtpchk normally without proxy protocol:
May 27 14:30:02 localhost haproxy[24755]: Server ft_postfix/postfix01
is UP, reason: Layer7 check passed, code: 220, info:
"mail.mydomain.com ESMTP Postfix (Ubuntu)", check duration: 2ms. 1
active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
I am using
http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev18.tar.gz
on Ubuntu 12.04.
Viet