This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15084|Reply: 0

[Memcached] memcached configuration to install and boot

[Copy link]
Posted on 10/21/2014 5:01:17 PM | | |
1. Install libevent

BecauseMemcachedThe libevent library is used to handle many open connections, so you need to install libevent first.
(The libevent API provides a mechanism for executing a callback function that triggers an event or executes the callback function after a timeout is reached.) )
Download libevent, the latest version is libevent-1.4.7-stable
citation
# wget -P /tmp http://www.monkey.org/~provos/libevent-1.4.7-stable.tar.gz

Unzip and install
citation
# cd /tmp
# tar zxvf libevent-1.4.7-stable.tar.gz
# cd libevent-1.4.7-stable
# ./configure --prefix=/usr
# make
# make install



2. Install memcached

Downloadmemcached, the latest version ismemcached-1.2.6
citation
# wget -P /tmp http://danga.com/memcached/dist/memcached-1.2.6.tar.gz

Unzip and install
citation
# cd /tmp
# tar zxvf memcached-1.2.6.tar.gz
# cd memcached-1.2.6
# ./configure --with-libevent=/usr
# make
# make install



3. Start memcached

citation
sudo /usr/local/bin/memcached -d -m 2048  -u root -l 127.0.0.1 -p 11211 -c 1024 -P /tmp/memcached.pid



Parameter description:
-d starts as a daemon
-m <num> assigned toMemcachedThe amount of memory used is in MB, and the default is 64MB
-u <username> runMemcachedof users, only when running as root
-l The <ip_addr> IP address of the server being listened to is the default value of the environment variable INDRR_ANY
-p <num> settingsMemcachedThe port to monitor is preferably a port of 1024 or higher
-c <num> Sets the maximum number of concurrent connections, which defaults to 1024
-P <file> settings saveMemcachedPID file, which is used in conjunction with the -d selection

There are also some parameters for specific references:
citation
# /usr/local/bin/memcached -h



4. End memcached

citation
# kill `/tmp/memcached.pid`

Note: The "'" in the command is not a single quote, but a single dot symbol for the keyboard "~" key.




Previous:The Orionid meteor shower is coming tonight, who are you waiting for romance with?
Next:The difference between kill -9 and no -9 in Linux is explained in detail
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com