Configuration now:
########################################
frontend app_api_front
bind *:80
mode http
default_backend app_api
backend app_api
mode http
balance hdr(X-Forwarded-For)
hash-type consistent
stick on hdr(X-Forwarded-For)
stick-table type string size 5M peers api
option httpchk GET /status
default-server inter 10000 rise 10 fall 2
server app01-staging-uswest2-aws
app01-staging-uswest2-aws.foobar.staging:8080 check
server app02-staging-uswest2-aws
app02-staging-uswest2-aws.foobar.staging:8080 check
peers api
peer haproxy-app01-staging-uswest2-aws.foobar.staging
haproxy-app01-staging-uswest2-aws.foobar.staging:8989
peer haproxy-app02-staging-uswest2-aws.foobar.staging
haproxy-app02-staging-uswest2-aws.foobar.staging:8989
########################################
Let's say I add a new backend, using completely different backend
servers, and a new frontend pointing at the new backend. Think of it as
a completely different website, but serviced by the same HAproxy
cluster. The new backend uses the same stickiness criteria like the old
one.
Can I re-use the same peers list for the new backend? Would each backend
maintain a separate stick table automatically?
Or do I have to create a new peers list for each backend? In that case,
can I use the same host:port for each peer member, or do I have to use
different ports for each peer list?
I other words, can I reuse the existing peers for the new backend, or do
I have to do this?
###################
peers api
peer one one:8989
peer two two:8989
peers api2
peer one one:8989
peer two two:8989
###################
Or do I have to do this?
###################
peers api
peer one one:8989
peer two two:8989
peers api2
peer one one:8990
peer two two:8990
###################
--
Florin Andrei
http://florin.myip.org/
########################################
frontend app_api_front
bind *:80
mode http
default_backend app_api
backend app_api
mode http
balance hdr(X-Forwarded-For)
hash-type consistent
stick on hdr(X-Forwarded-For)
stick-table type string size 5M peers api
option httpchk GET /status
default-server inter 10000 rise 10 fall 2
server app01-staging-uswest2-aws
app01-staging-uswest2-aws.foobar.staging:8080 check
server app02-staging-uswest2-aws
app02-staging-uswest2-aws.foobar.staging:8080 check
peers api
peer haproxy-app01-staging-uswest2-aws.foobar.staging
haproxy-app01-staging-uswest2-aws.foobar.staging:8989
peer haproxy-app02-staging-uswest2-aws.foobar.staging
haproxy-app02-staging-uswest2-aws.foobar.staging:8989
########################################
Let's say I add a new backend, using completely different backend
servers, and a new frontend pointing at the new backend. Think of it as
a completely different website, but serviced by the same HAproxy
cluster. The new backend uses the same stickiness criteria like the old
one.
Can I re-use the same peers list for the new backend? Would each backend
maintain a separate stick table automatically?
Or do I have to create a new peers list for each backend? In that case,
can I use the same host:port for each peer member, or do I have to use
different ports for each peer list?
I other words, can I reuse the existing peers for the new backend, or do
I have to do this?
###################
peers api
peer one one:8989
peer two two:8989
peers api2
peer one one:8989
peer two two:8989
###################
Or do I have to do this?
###################
peers api
peer one one:8989
peer two two:8989
peers api2
peer one one:8990
peer two two:8990
###################
--
Florin Andrei
http://florin.myip.org/