-2

I'm trying to connect the application server to the memcache server.

App Server 12.12.12.12
Memcache Server 13.13.13.13
Memcache Port 11211

I've tried the following.

Ping from 12.12.12.12 to 13.13.13.13 works
telnet 13.13.13.13 80 works
telnet 13.13.13.13 11211 doesn't work: No route to host found. 

Memcache is listening to 127.0.0.1 and therefore the UFW on 13.13.13.13 is set to:

To                         Action      From
--                         ------      ----
11211/tcp                  ALLOW       Anywhere
22                         ALLOW       Anywhere
Anywhere                   ALLOW       13.13.13.13
127.0.0.1 11211/tcp        ALLOW       13.13.13.13

Still the server is not responding and result is No route or host found.

UFW logging is enabled but the ufw log can't be found at /var/log/ufw.log

No I'm at the point of being clueless...

[UPDATE] Output of netstat -tunlp | grep 11211

tcp        0      0 13.13.13.13:11211       0.0.0.0:*               LISTEN      14378/memcached
udp        0      0 13.13.13.13:11211       0.0.0.0:*                           14378/memcached

ps aux | grep memcache

memcache 14378  0.0  0.0 335580  1440 ?        Sl   15:56   0:00 /usr/bin/memcached -m 3584 -p 11211 -u memcache -l 13.13.13.13
  • Have you verified that memcache is running? Can you telnet to it from the server itself? – Bert Jul 5 '16 at 19:32
  • Disable firewall to check if port issue? – Jason Jul 5 '16 at 20:25
  • @FrankThornton than it gives me no route to host – Peter Fox Jul 5 '16 at 20:31
2

Memcache is listening to 127.0.0.1

Well that's your problem. It's listening on a localhost address and as such, will not be available to other hosts on the network. You should have it listen on 0.0.0.0 (all addresses) or the specific non-localhost address required for your application.

  • Based on your comment, tried this: chanced memcached.conf to listen to -l 0.0.0.0 and added [0.0.0.0 11211 ALLOW 46.17.7.26] to the UFW. Doesn't work. Still no route to host. BTW ufw restarted, and memcached restarted – Peter Fox Jul 5 '16 at 19:51
  • Tried to have it listen to its own ip adres (13.13.13.13) but that doesn't work either. – Peter Fox Jul 5 '16 at 19:55
  • memcached.log is empty btw. – Peter Fox Jul 5 '16 at 19:55
  • Are you even sure that memcached is running at all? Please update your question with the output of $ netstat -tunlp | grep 11211 and $ ps aux | grep memcache. – EEAA Jul 5 '16 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.