1, ready to install software memcached and libevent (I am the latest version under the official website libevent-2.0.21-stable.tar.gz and memcached-1.4.21.tar.gz)
2, Installation Libevent
1) Unzip the file
TAR-ZXVF libevent-2.0.21-stable.tar.gz
2) Specify the installation path
./configure--prefix=/opt/
3) Installation
Make
Make install
4) test whether the installation is successful
Ls-al/opt/lib | grep libevent
3, installation memcached
1) Unzip the file
TAR-ZXVF memcached-1.4.21.tar.gz
2) specify Libevent path
./configure--with-libevent=/opt/
3) Installation
Make
Make install
The memcached will be automatically placed on the/usr/local/bin/memcached after installation is complete.
4) test whether the memcached is installed successfully
ls-al/usr/local/bin/mem*
5) Start memcached service
/usr/local/bin/memcached-d-M 10-u root-l 192.168.20.149-p 11211-c 256-p/tmp/memcached.pid
The-D option is to start a daemon,
-M is the amount of memory allocated to Memcache, in megabytes, I'm 10MB,
-U is the user running memcache, I am root here,
-L is the server IP address of the listener, if there are multiple addresses, I specify the server IP address 192.168.20.149,
-P is the port that sets Memcache listening, I set here 11211, preferably more than 1024 ports,
The-c option is the maximum number of concurrent connections to run, the default is 1024, I set the 256 here, according to the load of your server to set,
-P is set to save memcache PID file, I am here to save in/tmp/memcached.pid
6) Stop memcached
Kill ' Cat/tmp/memcached.pid '
Installation of memcached under Linux memcached knowledge finishing