0. this document describes how to install and deploy the memcached service operating system in linux: RedHatEnterpriseLinuxServerrelease5.4 (Tikanga) Memory: 4G1. verify that gcc is installed with the command line and run gcc-v to check whether gcc version information is output... 0. before getting started
This document describes how to install and deploy the memcached service in linux.
Operating system:
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Memory: 4 GB
1. verify that gcc is installed
Execute gcc-v on the command line to check whether the gcc version is output. If no gcc version is available, notify the O & M personnel to install
Appendix: output during normal gcc installation
[Root @ tyff000001 bin] # gcc-v
Using built-in specs.
Target: x86_64-redhat-linux
Configured :.. /configure -- prefix =/usr -- mandir =/usr/share/man -- infodir =/usr/share/info -- enable-shared -- enable-threads = posix -- enable-checking = release -- with-system-zlib -- enable-_ cxa_atexit -- disable-libunwind-exceptions -- enable-libgcj-multifile -- enable-versions ages = c, c ++, objc, obj-c ++, java, fortran, ada -- enable-java-awt = gtk -- disable-dssi -- enable-plugin -- with-java-home =/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre -- with-cpu = generic -- host = x86_64-redhat-linux
Thread model: posix
Gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
[Root @ tyff000001 bin] #
2. download the memcached source code package
Http://code.google.com/p/memcached/downloads/list
Currently, memcached-1.4.12.tar.gz is installed.
3. download the libevent package
Http://libevent.org/
Libevent-2.0.16-stable.tar.gz
4. decompress the memcached and libevent packages.
Upload the memcached-1.4.12.tar.gz and libevent-2.0.16-stable.tar.gz packages to the server.
For example,/home/kevin/software/
Switch the command line to this directory and run
Tar-zxvf memcached-1.4.12.tar.gz
Tar-zxvf ibevent-2.0.16-stable.tar.gz
Decompress the two packages
5. install
Install ibevent
Command line enter the decompressed libevent directory/home/kevin/software/libevent-2.0.16-stable
Run the following commands in sequence:
./Configure -- prefix =/usr/
Make
Make install # (note that the user running this command must have the permission to install the software-apply for a root user)
Verify installation
Ls/usr/lib | grep libevent
If the installation is correct, there will be output
Libevent-2.0.so.5
Libevent-2.0.so.5.1.4
Libevent.
Libevent_core-2.0.so.5
Libevent_core-2.0.so.5.1.4
Libevent_core.a
Libevent_core.la
Libevent_core.so
Libevent_extra-2.0.so.5
Libevent_extra-2.0.so.5.1.4
Libevent_extra.a
Libevent_extra.la
Libevent_extra.so
Libevent. la
Libevent_pthreads-2.0.so.5
Libevent_pthreads-2.0.so.5.1.4
Libevent_pthreads.a
Libevent_pthreads.la
Libevent_pthreads.so
Libevent. so
Install the memcached service
Switch to the memcached extract Directory
Cd/home/kevin/software/memcached-1.4.12
Run the following commands in sequence:
./Configure -- prefix =/usr/local/memcached -- with-libevent =/usr/
Make
Make install
Verify that memcached is successfully installed
Ls-al/usr/local/memcached/bin
Tip:
[Root @ tyff000001 memcached-1.4.12] # ls-al/usr/local/memcached/bin
Total 296
Drwxr-xr-x 2 root 4096 Feb 2.
Drwxr-xr-x 5 root 4096 Feb 2 ..
-Rwxr-xr-x 1 root 288370 Feb 2 memcached
6. start the Memcache server (the memory cache size is 3 GB)
Cd/usr/local/memcached/bin
./Memcached-d-m 3072
7. others
View memcached processes
Ps-e | grep memcache
Memcached startup parameters
-D option is to start a daemon,
-M indicates the amount of memory allocated to Memcache. the unit is MB. here it is 3072 MB (3 GB ),
-U is the user who runs Memcache. here is kevin,
-L is the IP address of the listener server.
-P is the port for Memcache listening. it is not specified as 11211 by default, preferably over 1024.
-The c option is the maximum number of concurrent connections. the default value is 1024, which is determined based on the load of your server.
-P is the pid file for saving Memcache. here I am saving it in/tmp/memcached. pid
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.