In Ubuntu10.10, 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. So we need equipment. Installing libevent2.0.10 is a prerequisite for installing Memcached1.4.5. Ubuntu 10 already has libevent1.4, but the version
In Ubuntu 10.10, 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. So we need equipment.
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
Music 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-m 128-u root-p 11211-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
Www.linuxidc.com @ linuxidc-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
Www.linuxidc.com @ linuxidc-laptop:/usr/local/lib $ ls-al/usr/lib | grep libevent
Telnet test memcached
Telnet to 192.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.