第一步,先安装lib-event

下载lib-event  的包http://libevent.org/

下载完之后,解压安装

  1. ./configure –prefix=/usr (或 ./configure --program-prefix=/usr)
  2. make
  3. make install

第二步,安装memcached

下载memcached的包http://www.memcached.org/downloads

下载完之后。解压安装

1、./configure

2、make

3、make install

通过命令 ls -al /usr/local/bin/mem*检測是否成功安装

默认情况下memcached安装到/usr/local/bin下。

启动memcached server。在安装文件夹下启动

/usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 11211 -c 256 -P /tmp/memcached.pid

root@chiwei-VirtualBox:/home/chiwei/disk/service# ls

root@chiwei-VirtualBox:/home/chiwei/disk/service# ls -al /usr/local/bin/memcached 

-rwxr-xr-x 1 root root 495978  7月 23 16:16 /usr/local/bin/memcached

root@chiwei-VirtualBox:/home/chiwei/disk/service# cd /usr/local/bin/me

-su: cd: /usr/local/bin/me: 没有那个文件或文件夹

root@chiwei-VirtualBox:/home/chiwei/disk/service# cd /usr/local/bin/

root@chiwei-VirtualBox:/usr/local/bin# ls

memcached

root@chiwei-VirtualBox:/usr/local/bin# ./memcached -d -c 1024 -l 127.0.0.1 -p 10101 -m 1024 -u root

root@chiwei-VirtualBox:/usr/local/bin# telnet 127.0.0.1 10101

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

stats

stats查看状态。flush_all:清楚缓存
查看memcached状态的基本命令,通过这个命令能够看到例如以下信息:
STAT pid 22459                             进程ID
STAT uptime 1027046                        server执行秒数
STAT time 1273043062                       server当前unix时间戳
STAT version 1.4.4                         server版本号
STAT pointer_size 64                       操作系统字大小(这台server是64位的)
STAT rusage_user 0.040000                  进程累计用户时间
STAT rusage_system 0.260000                进程累计系统时间
STAT curr_connections 10                   当前打开连接数
STAT total_connections 82                  曾打开的连接总数
STAT connection_structures 13              server分配的连接结构数
STAT cmd_get 54                            运行get命令总数
STAT cmd_set 34                            运行set命令总数
STAT cmd_flush 3                           指向flush_all命令总数
STAT get_hits 9                            get命中次数
STAT get_misses 45                         get未命中次数
STAT delete_misses 5                       delete未命中次数
STAT delete_hits 1                         delete命中次数
STAT incr_misses 0                         incr未命中次数
STAT incr_hits 0                           incr命中次数
STAT decr_misses 0                         decr未命中次数
STAT decr_hits 0                           decr命中次数
STAT cas_misses 0                          cas未命中次数
STAT cas_hits 0                            cas命中次数
STAT cas_badval 0                          使用擦拭次数
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 15785                      读取字节总数
STAT bytes_written 15222                   写入字节总数
STAT limit_maxbytes 1048576                分配的内存数(字节)
STAT accepting_conns 1                     眼下接受的链接数
STAT listen_disabled_num 0                
STAT threads 4                             线程数
STAT conn_yields 0
STAT bytes 0                               存储item字节数
STAT curr_items 0                          item个数
STAT total_items 34                        item总数
STAT evictions 0                           为获取空间删除item的总数

启动完之后,測试

telenet  127.0.0.1 10101

连接成功后,能够使用了

关闭memcached服务时,先查看tmp目录

root@chiwei-VirtualBox:~# ls

root@chiwei-VirtualBox:~# cd /tmp/

root@chiwei-VirtualBox:/tmp# ls

aptdaemon-WMCJDF                  qtsingleapp-chines-1a7c-3e8-lockfile

bjydJbU3Ux                        rpc%0049d%0043ache.data

deCgyLP7oi                        sms%0043ache.data

fcitx-socket-:0                   sni-qt_chinese-calendar_2043-z3cOqS

hsperfdata_chiwei                 sni-qt_sogou-qimpanel_2248-fTSQLu

hsperfdata_root                   sogou-qimpanel:0.pid

indicator-china-weather-1000.pid  sogou-qimpanelchiwei

jna                               ssh-Wcoq8f0CINjL

memcached.pid                     unity_support_test.1

qtsingleapp-chines-1a7c-3e8

有一个保存memcache的pid文件

kill `cat /tmp/memcached.pid`   键盘左上角的点符号

或者

root@chiwei-VirtualBox:~# ps -ef | grep memcached

root     24915  1584  0 16:36 ?

00:00:00 ./memcached -d -c 1024 -l 127.0.0.1 -p 10101 -m 1024 -u root

root     25011 10370  0 16:41 pts/15   00:00:00 grep --color=auto memcached

root@chiwei-VirtualBox:~# kill 24915

root@chiwei-VirtualBox:~# telnet 127.0.0.1 10101

Trying 127.0.0.1...

telnet: Unable to connect to remote host: Connection refused

root@chiwei-VirtualBox:~#

memcached详细的使用。參照http://www.cnblogs.com/czh-liyu/archive/2010/04/27/1722084.html

memcached 协议  点击打开链接


ubuntu14中 memcached安装与使用的更多相关文章

  1. .NET中MemCached使用介绍

    阅读目录 1.MemCached是什么? 2.Window中MemCached安装 3.MemCached命令 4.简单示例 MemCached是什么 MemCached是一个自由开源,高性能,分布式 ...

  2. ubuntu14.04为安装fcitx卸载ibus后出现system setting (系统设置)中图标消失的问题

    最近在系统为ubuntu14.04原版中,安装fictx.按照以往的经验应先把ibus卸载干净,否则可能会有冲突.因此惯性思维驱使,先卸载ibus,然后安装fcitx,但是问题出现了,system s ...

  3. Linux Memcached安装以及PHP扩展安装

    一:安装libevent 由于memcached安装时,需要使用libevent类库,所以先安装libevent 1.下载 #wget   http://www.monkey.org/~provos/ ...

  4. linux下memcached安装以及启动

    1. 准备安装文件 下载memcached与libevent的安装文件 http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz(me ...

  5. Ubuntu14.0下安装Zend Framework 2

    Ubuntu14.0下安装Zend Framework 2为了安装这个东西,忙活了快一天了,参考中文博客一直没有安装成功,有些博客的时间也是已经很早了,后来google看英文版的才安装成功,这里记录一 ...

  6. 【转】Memcached安装

    解析:Memcached是什么? Memcached是由Danga Interactive开发的,高性能的,分布式的内存对象缓存系统,用于在动态应用中减少数据库负载,提升访问速度. 一.软件版本    ...

  7. [译]How to Install Node.js on Ubuntu 14.04 如何在ubuntu14.04上安装node.js

    原文链接为 http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/ 由作者Jacob Nicholson 发表于October ...

  8. 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)

    在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...

  9. DICOM:Ubuntu14环境下安装dcm4chee+oviyam2.1

    背景: 之前博文DICOM:开源DICOM服务框架DCM4CHEE安装中曾介绍过在Windows7环境下安装部署dcm4chee.近期公司项目需要与部署到Linux系统的远端基于dcm4chee框架的 ...

随机推荐

  1. 8.不绑定(ngNonBindable)

    转自:https://www.cnblogs.com/best/tag/Angular/ ngNonBindable指令告诉Angular编译或绑定当前DOM元素的内容.这对于要求Angular忽略那 ...

  2. PL/SQL Developer怎么连接远程数据库

    首先打开电脑,到PL/SQL安装的指定目录 [D:\app\DZL\product\10.2.0\dbhome_1\NETWORK\ADMIN]或者[D:\oracle\product\10.2.0\ ...

  3. 参加2012 Openstack亚太技术大会

    参加2012 OpenStack亚太技术大会 OpenStack是一个由Rackspace发起.全球开发者共同参与的开源项目,旨在打造易于部署.功能丰富且易于扩展的云计算平台.OpenStack企图成 ...

  4. Python(四) 分支、循环、条件与枚举

    一.什么是表达式 表达式(Expression)是运算符(operator)和操作数(operand)所构成的序列 二.表达式的优先级 三.表达式优先级练习 优先级同级 从左往右计算 1 or 2 a ...

  5. C/C++(C++返回对象与应用区别,类成员的存储)

    返回对象与应用区别: 拷贝构造器发生的时机: 1.构造新对象 A a, A b = a; 2.传参或返回对象 对于普通变量来说,传引用效果不是很明显,对于类对象而言,传对象效果很高. 传引用等价于扩大 ...

  6. debian8平滑升级到debian9

    本文在Creative Commons许可证下发布. 首先,在升级时可以查看一下自己的版本号: uname -a ##查看内核信息 cat /etc/issue ##查看发行版本号   方法1:利用网 ...

  7. 洛谷 P1914 小书童——密码

    P1914 小书童——密码 题目背景 某蒟蒻迷上了“小书童”,有一天登陆时忘记密码了(他没绑定邮箱or手机),于是便把问题抛给了神犇你. 题目描述 蒟蒻虽然忘记密码,但他还记得密码是由一串字母组成.且 ...

  8. leetCode 85.Maximal Rectangle (最大矩阵) 解题思路和方法

    Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and ...

  9. C#加减乘除

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  10. RTSP传输协议之Methods总结

    RTSP/1.0 200 OK Server: DSS/5.5.5 (Build/489.16; Platform/Linux; Release/Darwin; state/beta; ) Cseq: ...