RHEL6.4 install and configure Memcached

Source: Internet
Author: User
Memcached is an open-source distributed memory cache system that reduces the load on databases and dynamic web pages. It caches Common Data Objects in the memory, the cache in the memory can be accessed through APIS. The following describes how to configure and install memcached in RHEL6.4. Memcahced depends on libevent and can be installed first. It can be installed using yum or the source code package. Here we will not repeat [root @ localhost ~] # Rpm-qa | g

Memcached is an open-source distributed memory cache system that reduces the load on databases and dynamic web pages. It caches Common Data Objects in the memory, the cache in the memory can be accessed through APIS. The following describes how to configure and install memcached in RHEL6.4.

Memcahced depends on libevent

You can install it first. It can be installed using yum or the source code package.

[Root @ localhost ~] # Rpm-qa | grep libevent


Libevent-headers-1.4.13-4.el6.noarch
Libevent-doc-1.4.13-4.el6.noarch
Libevent-1.4.13-4.el6.x86_64
Libevent-devel-1.4.13-4.el6.x86_64

Here, my system has installed this package. Install memcache below

: Http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz

[Root @ localhost src] # wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz

[Root @ localhost src] # tar-zxvf memcached-1.4.15.tar.gz

[Root @ localhost src] # cd memcached-1.4.15

[Root @ localhost memcached-1.4.15] #./configure
[Root @ localhost memcached-1.4.15] # make & make install

Installation Complete

Start memcached

Memcached-m 512 m-p 1666-d-u root-P/var/run/memcached. pid-c 1024

-M memory size used

-P port number

-D runs as the daemon background

-U indicates the user to run. By default, the user cannot run as root. If the user is run as root, this parameter must be used to specify the user.

-P the large P here is the pid File

-C maximum number of concurrent connections


-Vv: output information and errors to the screen


[Root @ localhost ~] # Lsof-I: 16000 // view the listener status
Command pid user fd type device size/OFF NODE NAME
Memcached 1257 root 26u IPv4 320330 0t0 TCP *: 16000 (LISTEN)
Memcached 1257 root 27u IPv6 320331 0t0 TCP *: 16000 (LISTEN)
Memcached 1257 root 28u IPv4 320334 0t0 UDP *: 16000
Memcached 1257 root 29u IPv6 320335 0t0 UDP *: 16000

Perform a simple test on it

[Root @ localhost ~] # Telnet to localhost 16000
Trying: 1...
Connected to localhost. // link to memcache
Escape character is '^]'.
Set test 0 0 10 // manually input and store the value to test
Test_value // The Input key is the data stored by test.
STORED
Get test // get the value of test
VALUE test 0 10 // The VALUE of the echo test
Test_value
END
Quit // exit
Connection closed by foreign host.

Refer:

Memcached installation and startup script http://www.linuxidc.com/Linux/2013-07/87641.htm

Http://www.linuxidc.com/Linux/2013-06/85883.htm for performance problems with Memcached in PHP

Installing Memcached in Ubuntu and command explanation http://www.linuxidc.com/Linux/2013-06/85832.htm

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

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.