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. 替换Quartus 自带编辑器 (转COM张)

    正文 此处以Quartus II 11.1和Notepad++ v5.9.6.2为例. 1. 使用QII自动调用Notepad++来打开HDL.sdc.txt等文件:并且可以在报错的时候,Notepa ...

  2. iOS学习笔记06—Category和Extension

    iOS学习笔记06—Category和Extension 一.概述 类别是一种为现有的类添加新方法的方式. 利用Objective-C的动态运行时分配机制,Category提供了一种比继承(inher ...

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

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

  4. 江南大学第三届程序设计竞赛K题 - Cun Tou Gaming - [贪心+堆]

    描述 CTG(Cun Tou Gaming) 是我校的一支 LOL 战队,他们参加比赛总是可以拿到冠军,因为每次都只有他们一支队伍参赛,所以只需要去签个到就可以直接夺冠并领取奖金.现在有  n 场比赛 ...

  5. SHU 414 - 字符串进制转换

    题目链接:http://acmoj.shu.edu.cn/problem/414/ 很咸鱼的网上拉了个进制转换模板过来,因为数组开的太小一直WA,后来一气之下MAXN开到1e5,真是蓝瘦…… 后来实在 ...

  6. Win10 下 RabbitMQ 的 安装 配置

    记录下本人在win10环境下安装RabbitMQ的步骤,以作备忘. 第一步:下载并安装erlang 原因:RabbitMQ服务端代码是使用并发式语言Erlang编写的,安装Rabbit MQ的前提是安 ...

  7. 单表行数超过 500 万行或者单表容量超过 2GB,才推荐进行分库分表。

    https://github.com/alibaba/p3c/blob/master/阿里巴巴Java开发手册(详尽版).pdf 单表行数超过 500 万行或者单表容量超过 2GB,才推荐进行分库分表 ...

  8. Rotate Image(二位数组顺时针旋转)

    问题描述: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockw ...

  9. 洛谷P2312 解方程 [noip2014] 数论

    正解:数论 解题报告: 这儿是,传送门qwq 又是很妙的一道题呢,专门用来对付我这种思维僵化了的傻逼的QAQ 首先看题目的数据范围,发现a<=1010000,很大的一个数据范围了呢,那这题肯定不 ...

  10. 【python-opencv】20-图像金字塔

    知识点介绍 图像金字塔原理: 高斯金字塔 拉普拉斯金字塔: 代码层面知识点:  cv2.PyrDown:降采样  cv2.PyrUp:升采样 高斯金字塔与拉普拉斯金字塔 图像金字塔是图像中多尺度表达的 ...