Memcached is a high-performance distributed memory cache server. Generally, the database query results are cached to reduce the number of database accesses, so as to speed up dynamic Web applications and improve scalability. Memcached is often used to store the result set and session information for database operations. Memcached is a must-have for home travel. The relevant file libevent-2.0.10-stable.tar.gzand memcached-1.4.5.tar. g to be used in this document
Memcached is a high-performance distributed memory cache server. Generally, the database query results are cached to reduce the number of database accesses, so as to speed up dynamic Web applications and improve scalability. Memcached is often used to store the result set and session information for database operations. Memcached is a must-have for home travel.
The relevant file libevent-2.0.10-stable.tar.gzand memcached-1.4.5.tar.gz to be used in this article download see http://www.linuxidc.com/Linux/2011-11/47949.htm
Install libevent2.0.10
This is a prerequisite for installing Memcached1.4.5. Ubuntu 10 already has libevent1.4, but the version is too low.
Rename-decompress-compile and install
- Mv libevent-2.0.10-Stable.tar.gz libevent2010.tar.gz
- Tar-zxvf libevent2010.tar.gz
- Cd libevent-2.0.10-Stable
- ./Configure-prefix =/usr/local
- Make
- Make install
After installation, check whether libevent and other files exist in/usr/local/lib.
Ls-al/usr/local/lib | grep libevent
Install memcache1.4.5
- Tar-zxvf memcached-1.4.5.Tar.gz
- Cd memcached-1.4.5
- ./Configure
- Make
- Sudo make install
View installation results
Ls-al/usr/local/bin/memcached
Start memcached
/Usr/local/bin/memcached-d-m128-U root-p11211-P/tmp/memcached. pid
Parameter:-d. Start the daemon (running in the background)
-M: Memory allocated to memcache. The unit is MB.
-U users running memcached
-L Server IP address of the listener
-P listens to the server port. The default value is 11211.
-P (uppercase) stores the Memcache pid file, followed by the path
Memcached startup Error
Guangbo @ guangbo-laptop:/usr/local/bin $/usr/local/bin/memcached-d-m 128-u root-p 11211-P/tmp/memcached. pid
/Usr/local/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
The libevent2.0 package is installed in/usr/local/lib.
Solution: Establish a soft connection
Sudo ln-s/usr/local/lib/libevent-2.0. So.5/Usr/lib/libevent-2.0. So.5
Check whether the creation is successful
Guangbo @ guangbo-laptop:/usr/local/lib $
Ls-al/usr/lib | grep libevent
Telnet test memcached
Telnet192.168.1.2 11211
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'
View version
- Version
VERSION 1.4.5
Stats View Details of memcached
Stats
STAT pid 9192
Statuptime 352
STAT time 1300907990
STAT version 1.4.5
STAT pointer_size 32
...
OK. memcached1.4.5 is successfully installed. This is a smooth operation, and there are not so many errors in nginx.