Quantcast
Channel: How can we create two instances of memcached server in same server in different port? - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by mikewied for How can we create two instances of memcached server in same server in different port?

$
0
0

Here's what memcached says the -l command is for:

-l <addr>     interface to listen on (default: INADDR_ANY, all addresses)
              <addr> may be specified as host:port. If you don't specify
              a port number, the value you specified with -p or -U is
              used. You may specify multiple addresses separated by comma
              or by using -l multiple times

First off you need to specify the interface you want memcached to listen on if you are using the -l flag. Use 0.0.0.0 for all interfaces and use 127.0.0.1 is you just want to be able to access memcached from localhost. Second, don't use two -l flags. Use only one and separate each address by a comma. The command below should do what you want.

memcached -l 0.0.0.0:11211,0.0.0.0:11212

Keep in mind that this will have one memcached instance listen on two ports. To have two memcached instances on one machine run these two commands.

memcached -p 11211 -d

memcached -p 11212 -d

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>