memcached安装

[root@localhost ~]# cd /usr/local/src

[root@localhost src]#wget http://www.memcached.org/files/memcached-1.4.34.tar.gz

[root@localhost memcached-1.4.34]# cd memcached-1.4.34

[root@localhost src]#wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz

[root@localhost src]# cd libevent-2.0.22

[root@localhost libevent-2.0.22]# ./configure --prefix=/usr/local/libevent

[root@localhost libevent-2.0.22]# make && make install

[root@localhost libevent-2.0.22]# cd /usr/local/src/memcached-1.4.34

[root@localhost memcached-1.4.34]# ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent

[root@localhost memcached-1.4.34]# make && make install

开启memcached

[root@localhost memcached-1.4.34]# cd /usr/local/memcached

memcached不能用root用户去开启,那么用普通用户开启

[root@localhost memcached]# ./bin/memcached -u xbl &

ok,memcached安装成功

pkill memcached

启动memcached

# /usr/local/memcached/bin/memcached -m 64 -p 11211 -u nobody -d

-p <num> tcp port number to listen on (default: 11211) // 监听
的端口
-u <num> udp port number to listen on (default: 0, off)
-s <file> unix socket path to listen on (disables network support)
-a <mask> access mask for unix socket, in octal (default 0700)
-l <ip_addr> interface to listen on, default is indrr_any
-d start tell memcached to start
-d restart tell running memcached to do a graceful restart
-d stop|shutdown tell running memcached to shutdown
-d install install memcached service // 把 memcached 注册成服务
-d uninstall uninstall memcached service
-r maximize core file limit
-u <username> assume identity of <username> (only when run as root)
-m <num> max memory to use for items in megabytes, default is 64
mb //分配给 memcached 的最大内存
-m return error on memory exhausted (rather than removing
items)

-c <num> max simultaneous connections, default is 1024 // 最大
的连接数
-k lock down all paged memory. note that there is a
limit on how much memory you may lock. trying to
allocate more than that would fail, so be sure you
set the limit correctly for the user you started
the daemon with (not for -u <username> user;
under sh this is done with 'ulimit -s -l num_kb').
-v verbose (print errors/warnings while in event loop) //
输出错误信息
-vv very verbose (also print client commands/reponses) //
输出所有信息
-h print this help and exit
-i print memcached and libevent license
-b run a managed instanced (mnemonic: buckets)
-p <file> save pid in <file>, only used with -d option
-f <factor> chunk size growth factor, default 1.25 //增长因子
-n <bytes> minimum space allocated for key+value+flags, default 48

来个小例子(key value)

[root@localhost memcached]# /usr/local/memcached/bin/memcached -m 64 -p 11211 -u nobody -d
[root@localhost memcached]# netstat -tupln|grep 11211
tcp        0      0 0.0.0.0:11211               0.0.0.0:*                   LISTEN      24244/memcached     
tcp        0      0 :::11211                    :::*                        LISTEN      24244/memcached     
udp        0      0 0.0.0.0:11211               0.0.0.0:*                               24244/memcached     
udp        0      0 :::11211                    :::*                                    24244/memcached     
[root@localhost memcached]# telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
add name 0 0 5
xiong
STORED
get name
VALUE name 0 5
xiong
END

memcached小试牛刀的更多相关文章

  1. 支持 .NET Core 的 Memcached 客户端 EnyimMemcachedCore

    1. 介绍 EnyimMemcachedCore 是一个支持 .NET Core 的 Memcached 客户端,是从 EnyimMemcached 迁移至 .NET Core的,源代码托管在 Git ...

  2. Key/Value之王Memcached初探:二、Memcached在.Net中的基本操作

    一.Memcached ClientLib For .Net 首先,不得不说,许多语言都实现了连接Memcached的客户端,其中以Perl.PHP为主. 仅仅memcached网站上列出的语言就有: ...

  3. Xamarin+Prism小试牛刀:定制跨平台Outlook邮箱应用(后续)

    在[Xamarin+Prism小试牛刀:定制跨平台Outlook邮箱应用]里面提到了Microsoft 身份认证,其实这也是一大块需要注意的地方,特作为后续补充这些知识点.上章是使用了Microsof ...

  4. ASP.Net MVC4+Memcached+CodeFirst实现分布式缓存

    ASP.Net MVC4+Memcached+CodeFirst实现分布式缓存 part 1:给我点时间,允许我感慨一下2016年 正好有时间,总结一下最近使用的一些技术,也算是为2016年画上一个完 ...

  5. 缓存、队列(Memcached、redis、RabbitMQ)

    本章内容: Memcached 简介.安装.使用 Python 操作 Memcached 天生支持集群 redis 简介.安装.使用.实例 Python 操作 Redis String.Hash.Li ...

  6. 企业做数据缓存是使用Memcached还是选Redis?

    企业是使用Memcached还是选Redis? 在构建一款现代且由数据库驱动的Web应用程序并希望使其拥有更为出色的性能表现时,这个问题总会时不时出现.并给每一位开发人员带来困扰.在考虑对应用程序的性 ...

  7. NoSql1 在Linux(CentOS)上安装memcached及使用

    前言:       今天是初五,生活基本要从过年的节奏中回归到正常的生活了,所以想想也该想想与工作有关的事情了.我之前在工作中会经常使用memcached和redis,但是自己一直没有时间系统的好好看 ...

  8. Memcached简介

    在Web服务开发中,服务端缓存是服务实现中所常常采用的一种提高服务性能的方法.其通过记录某部分计算结果来尝试避免再次执行得到该结果所需要的复杂计算,从而提高了服务的运行效率. 除了能够提高服务的运行效 ...

  9. Linux 服务器 安装 memcached

    linux centos 一.memcached的安装 1.下载 memcached-1.4.33.tar.gz.libevent-2.0.22-stable.tar.gz 安装 memcached ...

随机推荐

  1. Gnome排序

    Gnome排序(地精排序),起初由Hamid Sarbazi-Azad 于2000年提出,并被称为stupid排序,后来被Dick Grune描述并命名为“地精排序”,作为一个排序算法,和插入排序类似 ...

  2. Dockerfile ,ADD详细解读

    一.ADD指令 ADD指令的功能是将主机构建环境(上下文)目录中的文件和目录.以及一个URL标记的文件 拷贝到镜像中. 其格式是: ADD  源路径  目标路径 如: #test FROM ubunt ...

  3. for,for-each,for-in,for-of,map的比较

    参考: 全面解析JavaScript里的循环方法之forEach,for-in,for-of Iterator 和 for...of 循环 JavaScript Array 对象 常规for for循 ...

  4. cas 单点登录 --自定义审计日记@Audit()

    错误信息: org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [An ...

  5. url分发、isinstance、request.GET请求之QueryDict和urlencode、post和get请求、limit_choices_to(Model字段)

    这个的路径是怎么来的,是有一个个的url路由分发过来的 这两个是相等的,若url后面加括号了,那么前面就不用这个装饰器了:反之,若装饰器使用了,那么这个url后面就不要加括号了 eg:其他的views ...

  6. Druid在有赞的实践

    转载一篇自己在公司博客上的文章 一.Druid介绍 Druid 是 MetaMarket 公司研发,专为海量数据集上的做高性能 OLAP (OnLine Analysis Processing)而设计 ...

  7. java.lang.ClassNotFoundException: hudson.remoting.Launcher

    jenkins构建失败,错误信息如下: [yjp-dev-po-hrsync] $ "C:\Program Files\Java\jdk1.8.0_121/bin/java" -c ...

  8. Docker 学习应用篇之二: Docker的介绍和安装

    之前说过Docker的好处,Docker可以集装箱化的部署应用程序.那么Docker是通过什么实现的呢.要理解Docker内部构建,需要先理解Docker的四种部件 1)images:镜像,docke ...

  9. POJ2387-Till the cows come home【最短路】

    A - Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn t ...

  10. 源码 time sleep

    C:\Users\Administrator\.PyCharm2017.1\system\python_stubs\2083891348\time.py def sleep(seconds): # r ...