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. 2015.7.11js-10(无缝滚动)

    1.实现原理:setInterval定时器,让某元素position的left属性定时滚动,使用到js中的元素的offsetLeft属性. 2.案例:1.css的实现是外div是4张图片的总宽度,设置 ...

  2. IIS "rewrite.dll failed to load. The data is the error." 错误解决方法

    在Windows 10 build 17133.73上部署一个较老版本的ASP.NET 2.0程序,访问时候出现: Service Unavailable HTTP Error 503. The se ...

  3. ASP.NET 文件上传于下载

    本文主要介绍一下,在APS.NET中文件的简单上传于下载,上传是将文件上传到服务器的指定目录下,下载是从存入数据库中的路径,从服务器上下载. 1.上传文件 (1)页面代码 <table alig ...

  4. Java内存泄露监控工具:JVM监控工具介绍【转】

    jstack?-- 如果java程序崩溃生成core文件,jstack工具可以用来获得core文件的java stack和native stack的信息,从而可以轻松地知道java程序是如何崩溃和在程 ...

  5. c++的矩阵乘法加速trick

    最近读RNNLM的源代码,发现其实现矩阵乘法时使用了一个trick,这里描述一下这个trick. 首先是正常版的矩阵乘法(其实是矩阵乘向量) void matrixXvector(float* des ...

  6. 170822、解决PLSQL记录被另一个用户锁住的问题

    1.查看数据库锁,诊断锁的来源及类型: select object_id,session_id,locked_mode from v$locked_object; 或者用以下命令: select b. ...

  7. vue报错 Uncaught TypeError: Cannot read property ‘children ’ of null

    Uncaught TypeError: Cannot read property ‘children ’ of null ratings未渲染完毕,就跳走goods了,取消默认跳转,即可

  8. OpenCV学习笔记之CXCORE篇

    转自blog.csdn.net/bbzz2/article/details/50764209

  9. PAT-GPLT L1-039 - 古风排版 - [字符串输入输出]

    题目链接:https://www.patest.cn/contests/gplt/L1-039 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standar ...

  10. 怎么点击div之外的区域就隐藏这个div啊 找了很久,都没有很好解决

    方法一. <!DOCTYPE html><html><head><meta http-equiv="Content-Type" conte ...