Deploy Memcached In Debian 8.1 (amd64)

Source: Internet
Author: User

Deploy Memcached In Debian 8.1 (amd64)

Directory
1. Preparations for installing memcached
2. install and configure Memcached
3. Memcached common management commands
4. Memcached Test

1. Preparations for installing memcached
1.1 System Environment
Root @ com :~ # Cat/etc/issue
Debian GNU/Linux 8 \ n \ l
Root @ com :~ # Uname-r
3.16.0-4-amd64

1.2 change the software source and install common software packages

Root @ com :~ # Vim/etc/apt/sources. list # delete all the original content in this file and add the following content
Deb http://mirrors.163.com/debian/ jessie main
Deb http://mirrors.163.com/debian/ jessie-updates main
Deb http://mirrors.163.com/debian/ jessie-backports main
Deb-src http://mirrors.163.com/debian/ jessie main
Deb-src http://mirrors.163.com/debian/ jessie-updates main
Deb-src http://mirrors.163.com/debian/ jessie-backports main
Deb http://mirrors.163.com/debian-security/ jessie/updates main
Deb-src http://mirrors.163.com/debian-security/ jessie/updates main

Root @ com :~ # Apt-get update # Use this command to update the package list after changing the software source

Install the following three software, which is not necessary and optional.
123 root @ com :~ # Apt-get install vim
Root @ com :~ # Apt-get install sudo
Root @ com :~ # Apt-get install chkconfig

2. install and configure Memcached
Root @ com :~ # Apt-cache show memcached # view the memcached package information in the source
Package: memcached
Version: 1.4.21-1.1 # Here is the Version number
Installed-Size: 206
Maintainer: David Martínez Moreno <ender@debian.org>
Architecture: amd64
Depends: libc6 (> = 2.17), libevent-2.0-5 (> = 2.0.10-stable), libsasl2-2, perl, init-system-helpers (> = 1.18 ~), Lsb-base (> = 3.2-13), adduser
Suggests: libcache-memcached-perl, libmemcached, libanyevent-perl, libyaml-perl, libterm-readkey-perl
Description-en: high-performance memory object caching system
Danga Interactive developed memcached to enhance the speed of LiveJournal.com,
A site which was already doing 20 million + dynamic page views per day for 1
Million users with a bunch of webservers and a bunch of database servers.
Memcached dropped the database load to almost nothing, yielding faster page
Load times for users, better resource utilization, and faster access to
Databases on a memcache miss.
.
Memcached optimizes specific high-load serving applications that are designed
To take advantage of its versatile no-locking memory access system. Clients
Are available in several different programming ages, to suit the needs
Of the specific application. Traditionally this has been used in mod_perl
Apps to avoid storing large chunks of data in Apache memory, and to share
This burden implements SS several machines.
The Description-md5: f7b1936bf072e208b59db960aca4de8a
Homepage: http://www.memcached.org/
Tag: devel: profiler, implemented-in: c, interface: daemon, network: server,
Role: program, secteam: squeeze-limited-support,
Secteam: wheezy-limited-support
Section: web
Priority: optional
Filename: pool/main/m/memcached/memcached_1.4.21-1.1_amd64.deb
Size: 97362
MD5sum: db1f2159c2a7086d85b9839577490239
SHA1: a2139100c90351e25f232da7415caa0ff3dae052
SHA256: SHA256

 

123456789101112131415161718192021222324252627282930313233343536373839404142 root @ com :~ # Apt-get install memcached # Here the memcached software is installed
Root @ com :~ # Dpkg-L memcached # Check the files generated after the memcached package is installed, but the file "/etc/memcached. conf" is not displayed, which is strange.
/.
/Lib
/Lib/systemd
/Lib/systemd/system
/Lib/systemd/system/memcached. service
/Usr
/Usr/include
/Usr/include/memcached
/Usr/include/memcached/protocol_binary.h
/Usr/bin
/Usr/bin/memcached
/Usr/share
/Usr/share/man
/Usr/share/man/man1
/Usr/share/man/man1/memcached.1.gz
/Usr/share/memcached
/Usr/share/memcached. conf. default
/Usr/share/memcached/scripts
/Usr/share/memcached/scripts/mc_slab_mover
/Usr/share/memcached/scripts/README. damemtop
/Usr/share/memcached/scripts/damemtop. yaml
/Usr/share/memcached/scripts/damemtop
/Usr/share/memcached/scripts/memcached-tool
/Usr/share/memcached/scripts/systemd-memcached-wrapper
/Usr/share/memcached/scripts/start-memcached
/Usr/share/doc
/Usr/share/doc/memcached
/Usr/share/doc/memcached/NEWS.gz
/Usr/share/doc/memcached/protocol.txt.gz
/Usr/share/doc/memcached/changelog.Debian.gz
/Usr/share/doc/memcached/NEWS.Debian.gz
/Usr/share/doc/memcached/changelog.gz
/Usr/share/doc/memcached/copyright
/Usr/share/doc/memcached/README. Debian
/Usr/share/doc/memcached/README. md
/Etc
/Etc/init. d
/Etc/init. d/memcached
/Etc/default
/Etc/default/memcached

 

Root @ com :~ # Vim/etc/memcached. conf
Here, you only need to modify two parameters. One is to specify the memory size that memcached can use, as shown below:
-M 1024 # The default value is 64 M. Change it to the actual size.
The second is to modify the IP address of the listener. By default, memcached only listens to the local loopback address 127.0.0.1. Modify the actual IP address on the local Nic interface as follows:
-L 172.31.11.96

3. Memcached common management commands

Root @ com :~ # Service memcached start # start memcached
Root @ com :~ # Ss-ntnl | grep 11211
LISTEN 0 128 172.31.11.96: 11211 *:*
Root @ com :~ # Service memcached status # Check whether memcached has been started
● Memcached. service-memcached daemon
Loaded: loaded (/lib/systemd/system/memcached. service; enabled)
Active: active (running) since Thu 2015-08-13 14:06:44 CST; 2 min 47 s ago
Main PID: 17416 (memcached)
CGroup:/system. slice/memcached. service
2017-17416/usr/bin/memcached-m 1024-p 11211-u memcache-l 172.31.11.96
Root @ com :~ # Service memcached stop # stop memcached
Root @ com :~ # Chkconfig -- list | grep memcached # Check the startup levels of memcached.
Memcached 0: off 1: off 2: on 3: on 4: on 5: on 6: off

4. Memcached Test

Xshell: \> telnet 172.31.11.96 11211 # Use xshell to test
Connecting to 172.31.11.96: 11211...
Connection established.
To escape to local shell, press 'ctrl + Alt +] '.
Stats # enter the stats command to obtain the memcached status information
STAT pid 17416
Statuptime 1637
STAT time 1439447639
STAT version 1.4.21
STAT libevent 2.0.21-stable
STAT pointer_size 64
STAT rusage_user 0.036000
STAT rusage_system 0.052000
STAT curr_connections 5
STAT total_connections 7
STAT connection_structures 6
STAT reserved_fds 20
STAT performance_get 0
STAT performance_set 0
STAT 1__flush 0
STAT performance_touch 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 22
STAT bytes_written 1103
STAT limit_maxbytes 1073741824 # memory size, in bytes
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT hash_power_level 16
STAT hash_bytes 524288
STAT hash_is_expanding 0
STAT malloc_fails 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT expired_unfetched 0
STAT evicted_unfetched 0
STAT evictions 0
STAT reclaimed 0
STAT crawler_reclaimed 0
STAT lrutail_reflocked 0
END

------------------------------------------ Split line ------------------------------------------

Install and configure Memcached source code in CentOS 6.6

Memcached installation and startup script

Performance problems of using Memcached in PHP

Install Memcached in Ubuntu and its command explanation

Install and apply Memcached

Use Nginx + Memcached's small image storage solution

Getting started with Memcached

For details about Memcached, click here
Memcached: click here

This article permanently updates the link address:

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.