I'm attempting to setup haproxy to service all endpoints within an ECE deployment. First step with getting wildcard DNS setup is done. The problem is getting the endpoints passed through to the proxy servers. After googling I came up with this for a config but it's not working with attempts to open Kibana, Elasticsearch, or ES logs links in ECE timeout.
frontend fe_kib_es
bind *:9243 #acl is_wild hdr_dom(host) -m end .vcp-ecelab.mon.vzwops.com
acl is_wild hdr_dom(host) -i .vcp-ecelab.mon.vzwops.com #use_backend be_kib_es if is_wild
use_backend be_kib_es if { hdr_end(host) -i .vcp-ecelab.mon.vzwops.com }
you are making a call to to $CLUSTER_ID.vcp-ecelab.mon.vzwops.com:9243 over https Correct
haproxy is preserving the Host header (otherwise you'd need to set X-Found-Cluster ) .. (if this was wrong you'd get a different error though I think) I believe this is correct
eceproxylab-*-southlake.mon.vzwops.com:9200 is accessible from the haproxy box? Correct
You are sure that use_backend be_kib_es if { hdr_end(host) -i .vcp-ecelab.mon.vzwops.com } is doing the right thing? Not sure
Today I made some changes after reading the haproxy doesn't strip headers and haproxy allowed passing of the endpoints, but it broke the rule for the platform UI because ES, Kibana, and platform UI use the same domain name and forward to different locations. Here's what I did.
To handle UI/API differently from proxies, can you have another rule, which matches on the host being exactlyvcp-ecelab.mon.vzwops.com ... you could also reason on port if you're not mapping everything to 443 (eg 12443 vs 9243)
I had a hunt around and found this sample haproxy LB config, in case it helps:
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 310000ms
timeout server 310000ms
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
# Admin console LB
frontend haproxy-adminconsole
bind <HAPROXYHOST>:12400
default_backend adminconsole
backend adminconsole
balance roundrobin
server adminconsole-1 <HOST_ECE_1>:12400 check
server adminconsole-2 <HOST_ECE_2>:12400 check
server adminconsole-3 <HOST_ECE_3>:12400 check
frontend haproxy-adminconsole-ssl
bind <HAPROXYHOST>:12443
mode tcp
option tcplog
option ssl-hello-chk
default_backend haproxy-adminconsole-ssl
backend haproxy-adminconsole-ssl
mode tcp
option tcplog
balance roundrobin
server haproxy-adminconsole-ssl-1 <HOST_ECE_1>:12443 check
server haproxy-adminconsole-ssl-2 <HOST_ECE_2>:12443 check
server haproxy-adminconsole-ssl-3 <HOST_ECE_3>:12443 check
# Proxy LB
frontend haproxy-proxy
option httpchk GET /__elb_health__
bind <HAPROXYHOST>:9200
default_backend proxy
backend proxy
balance roundrobin
server proxy-1 <HOST_ECE_1>:9200 check port 9200
server proxy-2 <HOST_ECE_2>:9200 check port 9200
server proxy-3 <HOST_ECE_3>:9200 check port 9200
frontend haproxy-proxy-ssl
mode tcp
option tcplog
option httpchk GET /__elb_health__
option ssl-hello-chk
bind <HAPROXYHOST>:9243
default_backend proxy-ssl
backend proxy-ssl
balance roundrobin
mode tcp
option tcplog
server proxy-ssl-1 <HOST_ECE_1>:9243 check port 9200
server proxy-ssl-2 <HOST_ECE_2>:9243 check port 9200
server proxy-ssl-3 <HOST_ECE_3>:9243 check port 9200
listen stats
bind *:9000
mode http
balance
stats enable
stats uri /stats
stats realm HAProxy\ Statistics
stats auth admin:password-haproxy
stats admin if TRUE
I was able to get through haproxy with your example using port 9200 on the client side, thanks. Unfortunately port 9243 is blocked at our firewall, it takes an act of God to get a port opened, and as you know Kibana requires SSL for authentication. Is it possible to get Kibana to authenticate a client using port 9200?
And the problem is that firewall already lets through 9200 but not 9243?
Are you saying you are seeing problems with hitting kibana:9200 over HTTP? Because that should work fine, I think (you're actually hitting a proxy service that picks a Kibana instance and hits that over HTTPS)
If you have a moment I'd love to see the 9200 request (+ what you believe the haproxy maps it to) and the response from Kibana ... everyone here is scratching their heads over how it could happen
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.