[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: Choosing backend based on constant
From:       CJ Ess <zxcvbn4038 () gmail ! com>
Date:       2015-04-30 17:42:48
Message-ID: CA+p3EyyK+arGpTB_P0cbZx7yMh6g4tMEsAdQqDo-UD--ABD75Q () mail ! gmail ! com
[Download RAW message or body]

Perhaps this is more what you are looking for?
https://github.com/smarterclayton/haproxy-map-route-example

On Thu, Apr 30, 2015 at 11:43 AM, Veiko Kukk <vkukk@xvidservices.com> wrote:

> I'd like to manually add that constant string into configuration, not to
> get it from the traffic. It would help to reduce differences in haproxy
> configuration file between server groups and easier migration between
> groups.
>
> Best regards,
> Veiko
>
>
> On 30/04/15 18:06, Baptiste wrote:
>
>> On Thu, Apr 30, 2015 at 11:49 AM, Veiko Kukk <vkukk@xvidservices.com>
>> wrote:
>>
>>> Hi everybody
>>>
>>> I'd like to simplify my haproxy configuration management by using almost
>>> identical configurations for different groups of haproxy installations
>>> that
>>> use different backends based on string comparision. The only difference
>>> in
>>> haproxy configuration files of different groups would be that string.
>>>
>>> The configuration logic would be something like this (not syntactically
>>> correct for haproxy, I know, but should show what I wish to accomplish):
>>>
>>> constant = foo # first hostgroup configuration
>>> constant = bar # second hostgroup configuration
>>>
>>> # common configuration for all hostgroups
>>> use_backend ha_backend_foo if constant == foo
>>> use_backend ha_backend_bar if constant == bar
>>> ...
>>>
>>> I wonder how to specify that string and form acl to use in 'use_backend'
>>> statement?
>>>
>>> Thanks in advance,
>>> Veiko
>>>
>>
>>
>> Hi Veiko,
>>
>> The question is how do you set your constant, what piece of
>> information do you use from the traffic or whatever?
>> Then we may help you.
>>
>> Baptiste
>>
>>
>

[Attachment #3 (text/html)]

<div dir="ltr">Perhaps this is more what you are looking for?  <a \
href="https://github.com/smarterclayton/haproxy-map-route-example">https://github.com/smarterclayton/haproxy-map-route-example</a><div \
class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 30, 2015 at 11:43 AM, \
Veiko Kukk <span dir="ltr">&lt;<a href="mailto:vkukk@xvidservices.com" \
target="_blank">vkukk@xvidservices.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">I&#39;d like to manually add that constant string into \
configuration, not to get it from the traffic. It would help to reduce differences in \
haproxy configuration file between server groups and easier migration between \
groups.<br> <br>
Best regards,<br>
Veiko<div class="HOEnZb"><div class="h5"><br>
<br>
On 30/04/15 18:06, Baptiste wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> On Thu, Apr 30, 2015 at 11:49 AM, Veiko Kukk &lt;<a \
href="mailto:vkukk@xvidservices.com" target="_blank">vkukk@xvidservices.com</a>&gt; \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> Hi everybody<br>
<br>
I&#39;d like to simplify my haproxy configuration management by using almost<br>
identical configurations for different groups of haproxy installations that<br>
use different backends based on string comparision. The only difference in<br>
haproxy configuration files of different groups would be that string.<br>
<br>
The configuration logic would be something like this (not syntactically<br>
correct for haproxy, I know, but should show what I wish to accomplish):<br>
<br>
constant = foo # first hostgroup configuration<br>
constant = bar # second hostgroup configuration<br>
<br>
# common configuration for all hostgroups<br>
use_backend ha_backend_foo if constant == foo<br>
use_backend ha_backend_bar if constant == bar<br>
...<br>
<br>
I wonder how to specify that string and form acl to use in &#39;use_backend&#39;<br>
statement?<br>
<br>
Thanks in advance,<br>
Veiko<br>
</blockquote>
<br>
<br>
Hi Veiko,<br>
<br>
The question is how do you set your constant, what piece of<br>
information do you use from the traffic or whatever?<br>
Then we may help you.<br>
<br>
Baptiste<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic