Install Memcached1.4.5 in Ubuntu

Source: Internet
Author: User
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

  1. Mv libevent-2.0.10-Stable.tar.gz libevent2010.tar.gz
  2. Tar-zxvf libevent2010.tar.gz
  3. Cd libevent-2.0.10-Stable
  4. ./Configure-prefix =/usr/local
  5. Make
  6. 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

  1. Tar-zxvf memcached-1.4.5.Tar.gz
  2. Cd memcached-1.4.5
  3. ./Configure
  4. Make
  5. 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

  1. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.