Memcached Installing Notes on Linux

Source: Internet
Author: User
Tags memcached

The first kind of yum Mode installation

Memcached supports many platforms: Linux, FreeBSD, Solaris, Mac OS, or Windows.

The first step Linux system installation memcached, first install the Libevent library

Ubuntu/debian

sudo apt-get install libevent libevent-deve automatic Download installation (Ubuntu/Debian)

Redhat/fedora/centos

Yum Install libevent libevent-deve 
To see if the Libevent installation was successful



Step Two install memcached

Ubuntu/debian

sudo apt-get install memcached  

Redhat/fedora/centos

Yum Install memcached

Step three: Memcached-h appears the following instructions succeeded

Fourth Step start Memcache
Memcached-m 50-p 11212-d-C 8192-u Root

Memcached-m 500-p 11211-d-C 8192-u Root

To see if memcached starts execution: Netstat-lntup|grep mem

That means memcached is starting up.

If you start multiple instances, use memcached-m 500-p 11212-d-C 8192-u Root

You can adjust the lower port.

Start Memcache Common parameters

-P <num> Set TCP port number (default is not set to: 11211)

-U <num> UDP Listening port (default: 11211, 0 o'clock off)

-L <ip_addr> Bind address (default: All allowed, regardless of internal or external network or local replacement IP, there is a security risk, if set to 127.0.0.1 can only be native access)

-d runs in daemon mode

-U <username> bindings use specified for running processes <username>

-M <num> allowable maximum memory usage, Unit m (default: MB)

-P <file> writes the PID to the file <file>, which enables fast process termination behind and needs to be used with-D

The second way of installation can of course be installed by using a compiled installation

First step: Install Libevent

1. First Use: Ls-al/usr/lib | grep libevent to see if it is installed, and if it is installed and the version is less than 1.3, uninstall it first by: Rpm-e Libevent-nodeps.

2. Download the Libevent installation package: libevent-1.4.13-stable.tar.gz, then unzip.

3. Switch to the Libevent home directory after decompression: CD libevent-1.4.13-stable

4. Perform the following sequence:

    1. ./CONFIGURE–PREFIX=/USR (or./configure--program-prefix=/usr)
    2. Make
    3. Make install

Attention:
1) root permission may be required to perform the make install.

2) Libevent will be installed to/usr/lib or/usr/local/lib

5. Test whether the Libevent is installed successfully: Ls-al/usr/lib | grep libevent (or Ls-al/usr/local/lib | grep libevent)
A similar result indicates that the installation was successful:

Step Two: Install memcached

Source Code Installation

Download the latest version of memcached from its official website (http://memcached.org).

wget http:Memcached.org/latest Download the latest versionTar-zxvf memcached-1.x.  X.  Tar.  GZ Decompression Source cd memcached-1.x.  X
Tar-ZXVF memcached-1.x.< Span class= "PLN" >x.. GZ  decompression source CD memcached-1.x x  Enter directory ./configure Span class= "pun" >--prefix=/usr/local< Span class= "pun" >/memcached  config make & & make test  compile sudo make install  Installation   

Whether it is a compile installation or Yum installation after installing memcached to see if it is installed before starting to see if the installation is used: which memcached jumps to the memcached installation directory

Then execute: The results of the Memcached-h show that the installation was successful

If you do not see the above interface instructions, you cannot find the libevent

Solution machine is find/-name "libevent-1.4.so.2"

If it is compiled and installed memcached execution memcached-h will report the following error

Vi/etc/ld.so.conf

Join

/usr/local/lib

Save

And then ldconfig to make it effective.

Step three: Memcached-h appears the following instructions succeeded

Fourth Step start Memcache

Memcached-m 500-p 11211-d-C 8192-u Root

To see if memcached starts execution: Netstat-lntup|grep mem

That means memcached is starting up.

If you start multiple instances, use memcached-m 500-p 11212-d-C 8192-u Root

You can adjust the lower port.

Memcached Installing Notes on Linux

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.