Welcome! Log In Create A New Profile

Advanced

listen to multiple IPs(clients)

Posted by ligerdave 
ligerdave
listen to multiple IPs(clients)
September 16, 2010 09:10PM
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
Re: listen to multiple IPs(clients)
September 16, 2010 10:12PM
On 16. sep. 2010, at 20.44, ligerdave wrote:

> 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?
>
>

It is copied at: http://github.com/memcached/memcached/blob/master/memcached.c#L4384

but you may want to look at where it's used:

http://github.com/memcached/memcached/blob/master/memcached.c#L3824

Trond
ligerdave
Re: listen to multiple IPs(clients)
September 17, 2010 01:00AM
so is it possible to use -l ip1,ip2,..... ?



On Sep 16, 4:04 pm, Trond Norbye <[email protected]> wrote:
> On 16. sep. 2010, at 20.44, ligerdave wrote:
>
> > 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?
>
> It is copied at:http://github.com/memcached/memcached/blob/master/memcached.c#L4384
>
> but you may want to look at where it's used:
>
> http://github.com/memcached/memcached/blob/master/memcached.c#L3824
>
> Trond
Trond Norbye
Re: listen to multiple IPs(clients)
September 17, 2010 07:01AM
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
Re: listen to multiple IPs(clients)
September 17, 2010 12:01PM
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

On Fri, Sep 17, 2010 at 10:27 AM, Trond Norbye <[email protected]>wrote:

>
> 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
>
>
Trond Norbye
Re: listen to multiple IPs(clients)
September 17, 2010 12:01PM
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
>
> On Fri, Sep 17, 2010 at 10:27 AM, Trond Norbye <[email protected]> wrote:
>
> 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
Re: listen to multiple IPs(clients)
September 17, 2010 12:10PM
On Fri, Sep 17, 2010 at 12:14 AM, ligerdave <[email protected]> wrote:

> 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?
>
>
> @ligerdave,
i think you meant strdup() ..its string duplicate function ( more info :
man strdup )
ligerdave
Re: listen to multiple IPs(clients)
September 17, 2010 05:50PM
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 <[email protected]> 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
>
> > On Fri, Sep 17, 2010 at 10:27 AM, Trond Norbye <[email protected]> wrote:
>
> > 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
Sorry, only registered users may post in this forum.

Click here to login