Linode Forum Index Linode Forum
Linode Community Forums
 


memcached

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
cap



Joined: 02 Apr 2010
Posts: 13

Posted: Thu Apr 22, 2010 8:49 pm    Post subject: memcached  

Trying to set up memcached to share memory between two nodes, I'm having a problem making a connection on port 11211 with one of them. When I run netstat on both nodes, I get:

tcp 0 0 localhost:11211 *:* LISTEN 16952/memcached

tcp 0 0 *:11211 *:* LISTEN 19278/memcached

The first node above can connect to the second, but the second can't connect to the first. Same with telnet. The way I read that is the ports are bound to different servers? On the first 11211 is bound to localhost, the other it's allowing a connection from all (*)?

Am I on the right track, and if so, any idea how to change the first node to accept connections from all?

Thanks.
Back to top  
obs



Joined: 07 Mar 2010
Posts: 1400
Location: Earth

Posted: Fri Apr 23, 2010 12:11 am    Post subject:  

Your assumption looks correct, the first is bound to localhost the second is bound to any ip.

Memcached should not be exposed to the internet so make sure that you have iptables blocking access from the world (and your "private" ip address if you have one, since it's private between all linode users).

You can open up the first one to use all addresses by removing the -l from memcached configuration line.
Back to top  
cap



Joined: 02 Apr 2010
Posts: 13

Posted: Fri Apr 23, 2010 11:45 am    Post subject:  

Thanks for the reply. Yes, I had thought of that, and tried it. But it doesn't work. If I configure with: "memcached -d -m 20" I still get the netstat below:

tcp 0 0 localhost:11211 *:* LISTEN 2769/memcached

When I enter another IP behind -l (I even tried -l *), the port still remains bound to localhost.

Both these machines are ubuntu karmic, and I set them up the same way. When I installed memcached, I took the same steps for both.

Any ideas?

Thanks.
Back to top  
cap



Joined: 02 Apr 2010
Posts: 13

Posted: Fri Apr 23, 2010 12:00 pm    Post subject:  

okay. Researching this on the web, most information says the configuration is done at the command line. But there is in fact a config file at /etc/memcached.conf that was specifying the bind port. Easy. Should have figured.

Thanks.
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1