I tried to add in the way -l 11211 -l 11212 in memcached conf file. But it is just listening to first one i.e 1121
By default, UEM Server components such as DS, CN, API, and SSP talk over TCP on port 11211. When you install Memcached into your configuration, it automatically selects this port. If your network is locked down and ports must be unlocked manually, unlock port 11211 before you proceed with the installation.
They both have very basic difference while storing value. Memcache mostly considers every value as string whereas Memcached stores it value's original type. Thumbs up for your answer !
Memcached statistics hold a lot of valuable information. For example, the total number of items (i.e. key-value pairs) stored in Memcached, can be useful information to move forward. The total number of items stored in Memcached is 10.
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
First I used mikewied's solution, but then I bumped into the problem of auto starting the daemon. Another confusing thing in that solution is that it doesn't use the config from etc. I was about to create my own start up scripts in /etc/init.d but then I looked into /etc/init.d/memcached file and saw this beautiful solution
# Usage: # cp /etc/memcached.conf /etc/memcached_server1.conf # cp /etc/memcached.conf /etc/memcached_server2.conf # start all instances: # /etc/init.d/memcached start # start one instance: # /etc/init.d/memcached start server1 # stop all instances: # /etc/init.d/memcached stop # stop one instance: # /etc/init.d/memcached stop server1 # There is no "status" command.
Basically readers of this question just need to read the /etc/init.d/memcached
file.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With