Re: Multiple outgoing addresses for squid?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 03 Apr 2012 14:57:06 +1200

On 03.04.2012 13:56, Eliezer Croitoru wrote:
> On 30/03/2012 16:28, Chris Ross wrote:
>>
>> On Mar 29, 2012, at 8:45 PM, Robert Collins wrote:
>>> 2012/3/30 Henrik Nordström<henrik_at_henriknordstrom.net>:
>>>>> Can tcp_outgoing_address take multiple addresses now? Does it
>>>>> just round-robin through them?
>>>>
>>>> It can only select one per request at the moment.
> i was trying to build such an external_acl thing and something is
> wrong
> i dont quit understand.
> the script was:
>
>
> #!/bin/bash
> i=0
> while read line; do
>
> if [ $i == 1 ]
> then
> echo 'OK'
> i=0
> else
> echo 'ERR'
> i=1
> fi
> done
>
> and on squid.conf tried:
>
> external_acl_type rrselector %URI /somedir/script.sh ttl=0
> negative_ttl=0 grace=0 children-startup=1 children-max=1

directive options go before the % format codes. The above says that
helper command line is:
"/somedir/script.sh ttl=0 negative_ttl=0 grace=0 children-startup=1
children-max=1"

>
> acl rrs external rrselector
>
> tcp_outgoing_address 10.0.0.1 rrs
> tcp_outgoing_address 10.0.0.2 !rrs
>
>
> but i seems to get this output every time i do a request.

tcp_outgoing_address is a "fast" group ACL check. It can use previously
cached results or schedule lookups, but cannot wait for them to
complete.

If you get that config right your *=0 settings will prevent the
triggered lookups from caching any results, and the new lookup can't be
waited for so there is never any match possible.

>
> 2012/04/03 04:48:33.356 kid1| external_acl.cc(778) aclMatchExternal:
> acl="rrs1"
> 2012/04/03 04:48:33.356 kid1| external_acl.cc(807) aclMatchExternal:
> No helper entry available
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal:
> rrs1("192.168.10.100") = lookup needed
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
> entry=@0, age=0
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
> queueing a call.
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
> return -1.
> 2012/04/03 04:48:33.356 kid1| external_acl.cc(778) aclMatchExternal:
> acl="rrs1"
> 2012/04/03 04:48:33.356 kid1| external_acl.cc(807) aclMatchExternal:
> No helper entry available
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal:
> rrs1("192.168.10.100") = lookup needed
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
> entry=@0, age=0
> 2012/04/03 04:48:33.356 kid1| aclMatchExternal: "192.168.10.100":
> queueing a call.
> 2012/04/03 04:48:33.357 kid1| aclMatchExternal: "192.168.10.100":
> return -1.
>
>
> i am trying to understand what i did wrong.
> i have used only one children to avoid any problem of two different
> RR counts.

The "" quoted part is the lookup being passed to the helper. So either
you actually used %SRC or %DST etc in your external_acl_type format or
those lines are not related toe the tcp_outgoing_address lookups.

Amos
Received on Tue Apr 03 2012 - 02:57:11 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 03 2012 - 12:00:04 MDT