listen to multiple IPs(clients)

375 views
Skip to first unread message

ligerdave

unread,
Sep 16, 2010, 2:44:44 PM9/16/10
to memcached
Folks,

I would like to set my memcache instance to listen to only a list of
given IPs.

I know you can specify an IP/interface by using -l 127.0.0.1. Is it
possible to do something like this: -l ip1,ip2,ip3

I was trying to find its source code for stddup(), the piece dealing
with -l argument. Does anyone know where to find it?


Trond Norbye

unread,
Sep 16, 2010, 4:04:10 PM9/16/10
to memc...@googlegroups.com

ligerdave

unread,
Sep 16, 2010, 6:57:01 PM9/16/10
to memcached
so is it possible to use -l ip1,ip2,..... ?

Trond Norbye

unread,
Sep 17, 2010, 12:57:06 AM9/17/10
to memc...@googlegroups.com

On 17. sep. 2010, at 00.57, ligerdave wrote:

> so is it possible to use -l ip1,ip2,..... ?
>
>

No, you asked for where in the code it used the -l argument, and memcached does currently not tokenize the argument to -l.

Cheers,

Trond

manoher tadakokkula

unread,
Sep 17, 2010, 5:10:16 AM9/17/10
to memc...@googlegroups.com
@ligerdave,
  i think you meant strdup() ..its string duplicate function ( more info : man strdup )

manoher tadakokkula

unread,
Sep 17, 2010, 4:59:58 AM9/17/10
to memc...@googlegroups.com
Does that mean memcahed can be set to listen on either Single IP or ALL IPs , but no to fixed pool of IPs ?

memcahed newbie,
Manoher T

Trond Norbye

unread,
Sep 17, 2010, 5:58:39 AM9/17/10
to memc...@googlegroups.com
On 17. sep. 2010, at 10.59, manoher tadakokkula wrote:

Does that mean memcahed can be set to listen on either Single IP or ALL IPs , but no to fixed pool of IPs ?


Yes. If you look at one of the last link i added in my first response you would see how the -l argument is handled. It should be fairly simple to modify the code to tokenize the string and bind to each of the ip's you specify.

Trond

ligerdave

unread,
Sep 17, 2010, 11:46:57 AM9/17/10
to memcached
is this planned to be included in any quick official fix or
improvement? you know this could be a headache if i have to modify/
build the code every time when there is new release.

@Manoher, yes, it's a typo. however, actually i meant to type
getaddrinfo().

@Trond, i just realized that i typed strdup here. i was indeed looking
for getaddrinfo()

On Sep 17, 5:58 am, Trond Norbye <trond.nor...@gmail.com> wrote:
> On 17. sep. 2010, at 10.59, manoher tadakokkula wrote:
>
> > Does that mean memcahed can be set to listen on either Single IP or ALL IPs , but no to fixed pool of IPs ?
>
> Yes. If you look at one of the last link i added in my first response you would see how the -l argument is handled. It should be fairly simple to modify the code to tokenize the string and bind to each of the ip's you specify.
>
> Trond
>
> > memcahed newbie,
> > Manoher T
>
Reply all
Reply to author
Forward
0 new messages