Linux under memcached installation __linux

Source: Internet
Author: User
Tags memcached mkdir
memcached Installation


1. Download, memcached need to install first libevent

Memcached's download Address: Http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gzs

Http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz Latest edition
Libevent's download Address: http://www.monkey.org/~provos/libevent-1.2.tar.gz

http://www.monkey.org/~provos/libevent/

#cd/usr/local
#mkdir memcached
#mkdir libevent

2. Install Libevent

# tar XZVF libevent-1.2.tar.gz
# CD libevent-1.2
#./configure--prefix=/usr/local/libevent
# make
# make Install

Check to see if the installation was successful:

#cd/usr/local/libevent/lib

If there are libevent-1.3c.so.1 libevent-1.3c.so.1.0.3 libevent.a libevent.la libevent.so These files exist, the installation is successful

3. Install memcached

# tar XZVF memcached-1.2.6.tar.gz
# CD memcached-1.2.6
#./configure--with-libevent=/usr/local/libevent--prefix=/usr/local/memcached
# make
# make Install

Check to see if the installation was successful:

#cd/usr/local/memcached/bin

If memcached memcached-debug These 2 files exist, the installation is successful

4. Implementation

#cd/usr/local/memcached/bin
#./memcached-h

If it appears:
1. memcached 1.2.6
2.-P TCP Port number to listen on (default:11211)
3.-U UDP port number to listen on (default:0, off)
4-S UNIX socket path to listen on (disables network support)
5. L interface to listen on, the default is Indrr_any
6.-D Run as a daemon
7.-R Maximize Core file limit
8-U assume identity of (only when run as root)
9.-M max memory to use for items in megabytes, default is MB
-M return error on memory exhausted (rather than removing items)
-C Max simultaneous connections, default is 1024
-K Lock down all paged memory
-V Verbose (print errors/warnings while in event loop)
-VV very verbose (also print client commands/reponses)
-H Print this help and exit
I-I print memcached and libevent license
-B Run a managed instanced (mnemonic:buckets)
-P Save PID in, only used with-d option
-F Chunk size growth factor, default 1.25
-N minimum space allocated for key+value+flags, default 48

Description The installation was successful and the path was configured correctly.

There may be:

Memcached:error while loading shared libraries:libevent-1.2.so.1:cannot open Shared object file:no such file or direct Ory

Description did not find the file: libevent-1.2.so.1

Solution:

First step. To view the next Lib path:
[Farman@localhost bin]$ Ld_debug=libs/usr/local/memcached/bin/memcached-v
31386:find library=libevent-1.2.so.1 [0]; Searching
31386:search Cache=/etc/ld.so.cache
31386:search path=/lib/tls/i686/sse2:/lib/tls/i686:/lib/tls/sse2:/lib/tls:/lib/i686/sse2:/lib/i686:/lib/sse2:/ lib:/usr/lib/tls/i686/sse2:/usr/lib/tls/i686:/usr/lib/tls/sse2:/usr/lib/tls:/usr/lib/i686/sse2:/usr/lib/i686:/ Usr/lib/sse2:/usr/lib (System search Path)
31386:trying file=/lib/tls/i686/sse2/libevent-1.2.so.1
31386:trying file=/lib/tls/i686/libevent-1.2.so.1
31386:trying file=/lib/tls/sse2/libevent-1.2.so.1
31386:trying file=/lib/tls/libevent-1.2.so.1
31386:trying file=/lib/i686/sse2/libevent-1.2.so.1
31386:trying file=/lib/i686/libevent-1.2.so.1
31386:trying file=/lib/sse2/libevent-1.2.so.1
31386:trying file=/lib/libevent-1.2.so.1
31386:trying file=/usr/lib/tls/i686/sse2/libevent-1.2.so.1
31386:trying file=/usr/lib/tls/i686/libevent-1.2.so.1
31386:trying file=/usr/lib/tls/sse2/libevent-1.2.so.1
31386:trying file=/usr/lib/tls/libevent-1.2.so.1
31386:trying file=/usr/lib/i686/sse2/libevent-1.2.so.1
31386:trying file=/usr/lib/i686/libevent-1.2.so.1
31386:trying file=/usr/lib/sse2/libevent-1.2.so.1
31386:trying file=/usr/lib/libevent-1.2.so.1
31386:
/home/farman/cacheinstall/bin/memcached:error while loading shared libraries:libevent-1.2.so.1:cannot open shared Object File:no such file or directory

Step two. It's OK to copy libevent-1.3c.so.1 to any one of the listed Lib.
or soft links
[Farman@localhost lib]$ su Root
Password:
[Root@localhost lib]# ln-s/home/farman/install/lib/libevent-1.2.so.1/usr/lib/libevent-1.2.so.1

To start the service:
[Root@localhost lib]# exit
Cannot start with root

Front start test
[Farman@localhost bin]#./memcached-m 10-p 12000-c 256-vv

Background boot
[Farman@localhost bin]#./memcached-d-M 10-p 12000-c 256-p/tmp/memcached.pid
./memcached-d-M 128-u root-l 127.0.0.1-p 11211-c 64-p/tmp/memcached.pid
Parameter description:

The-D option is to start a daemon
-M is the amount of memory allocated to Memcache, in megabytes, I am 10MB
-U is the user running memcache, I am here root
-L is a listening server IP address
-P is the port to set memcache listening, preferably over 1024 ports
The-c option is the maximum number of concurrent connections to run, the default is 1024, according to the amount of load on your server to set
-P is to set the PID file to save Memcache

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.